Symbian-Developers

The Official Developers Section => Symbian Software Development Discussions => The Developers Section => Qt Application Development => Topic started by: asturcon3 on January 07, 2015, 03:33:45 pm

Title: On new image/music/video, how to notify to the system
Post by: asturcon3 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();
    }
Title: Re: On new image/music/video, how to notify to the system
Post by: Allstar12345 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