• April 18, 2024, 05:17:04 pm

Author Topic: On new image/music/video, how to notify to the system  (Read 2951 times)

0 Members and 1 Guest are viewing this topic.

Offline asturcon3

  • Viewer
  • *
  • Posts: 5
  • Reputation: 0
  • Symbian Power User
  • Current Phone: : 808PV, E7, N97mini
On new image/music/video, how to notify to the system
« on: January 07, 2015, 03:33:45 pm »
So I'm saving (downloading) new multimedia files to the appropriate folders, then opening the image gallery, or music gallery (however it's call on English version), or videos app. Only to find that there's nothing new there, on the music gallery I can manually refresh and then it finds the new file. On the image gallery I have to reset the phone to force a refresh.

Do you know how to notify the system that a new multimedia file is available so it can update its cache?

My current code to save files is pretty simple.

Code: [Select]
private slots:
    void fileDownloaded(QNetworkReply* pReply) {
        QVariant possibleRedirectUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
        /* We'll deduct if the redirection is valid in the redirectUrl function */
        QUrl _urlRedirectedTo = this->redirectUrl(possibleRedirectUrl.toUrl(),_urlRedirectedTo);
        if(!_urlRedirectedTo.isEmpty()) {
            QNetworkRequest request(_urlRedirectedTo);
            reply=m_WebCtrl.get(request);
            connect(reply,SIGNAL(downloadProgress(qint64,qint64)),
                    SLOT(fileDownloading(qint64,qint64)));
            connect(reply,SIGNAL(readyRead()),
                    SLOT(readyRead()));
            downloadTo.close();
            downloadTo.open(QIODevice::WriteOnly);
        } else {
            QByteArray m_DownloadedData;
            m_DownloadedData = pReply->readAll();
            downloadTo.write(m_DownloadedData);
            downloadTo.close();
            //emit a signal
            emit downloaded();
        }
        pReply->deleteLater();
    }

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
Re: On new image/music/video, how to notify to the system
« Reply #1 on: January 07, 2015, 03:50:52 pm »
Not sure if there is a way to notify it, but the gallery and video should auto update, it does when my Star Browser saves to drive/images for screen shots.

You could delete the database files but that wouldn't really be a proper solution considering how long it takes to delete and refresh