void BrowseMainWindow::onAddToPlaylist() {
QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue");
- url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\")));
+ url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
mNetManager->get(QNetworkRequest(url));
//mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
}
void BrowseMainWindow::onPlay() {
QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_play");
- url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\")));
+ url.addEncodedQueryItem(QByteArray("input"), QUrl::toPercentEncoding(mCurrentElement.path.replace("\\", "\\\\").replace("'", "\\'")));
mNetManager->get(QNetworkRequest(url));
//mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_play&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
}
url.addEncodedQueryItem(QByteArray("dir"), QUrl::toPercentEncoding(dir));
QNetworkReply * reply = mNetManager->get(QNetworkRequest(url));
//QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir.replace("&", "%26").replace("\\", "\\\\"))));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+#endif
connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
connect(reply,SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(error(QNetworkReply::NetworkError)));
connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
}
void BrowseMainWindow::error(QNetworkReply::NetworkError code) {
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
qDebug() << code;
}
void BrowseMainWindow::readReady() {
this->parseXmlDirectory();
// only interested in finished signals
disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
}
void BrowseMainWindow::parseXmlDirectory() {
QDomDocument doc;