Working basic windows file browsing
authordruid23 <usr@dru-id.co.uk>
Wed, 18 Aug 2010 01:29:22 +0000 (02:29 +0100)
committerdruid23 <usr@dru-id.co.uk>
Wed, 18 Aug 2010 01:29:22 +0000 (02:29 +0100)
modified:   browsemainwindow.cpp
modified:   playlistmainwindow.cpp

browsemainwindow.cpp
playlistmainwindow.cpp

index 369464f..874c384 100644 (file)
@@ -130,10 +130,12 @@ void BrowseMainWindow::onBrowse() {
 }
 
 void BrowseMainWindow::onAddToPlaylist() {
+    qDebug() << QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue&input=" + mCurrentElement.path.replace("\\", "\\\\")).toString();
     /*QNetworkReply * reply = */ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
                              }
 
 void BrowseMainWindow::onPlay() {
+    qDebug() << QUrl("http://"+mIp+"/requests/status.xml?command=in_play&input=" + mCurrentElement.path.replace("\\", "\\\\")).toString();
     /*QNetworkReply * reply = */ mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/status.xml?command=in_play&input=" + mCurrentElement.path.replace("\\", "\\\\"))));
                              }
 
@@ -141,7 +143,8 @@ void BrowseMainWindow::browseDirectory(QString dir) {
     mContents->clear();
     ui->listWidget->clear();
     mResponse.clear();
-    QNetworkReply * reply =  mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir)));
+    qDebug() << QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir.replace("\\", "\\\\")).toString();
+    QNetworkReply * reply =  mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/browse.xml?dir=" + dir.replace("\\", "\\\\"))));
     connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
     connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
 }
index fc43b99..ebe67cf 100644 (file)
@@ -167,7 +167,7 @@ void PlayListMainWindow::parseXmlPlayList() {
   for (int idx = 0; idx < ct; ++idx) {
     QDomNode node = nodes.at(idx);
     QString current = "";
-    QString name = node.attributes().namedItem("name").nodeValue();
+    //QString name = node.attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
     int id = node.attributes().namedItem("id").nodeValue().toInt();
     if (4 > id && 0 == QString::compare(node.attributes().namedItem("ro").nodeValue(), "ro")) {
       // got the main playlist, let's build it up
@@ -180,7 +180,7 @@ void PlayListMainWindow::parseXmlPlayList() {
             VlcPlayListElementSimple* el = new VlcPlayListElementSimple();
             el->id = leaf.attributes().namedItem("id").nodeValue().toInt();
             el->path = leaf.attributes().namedItem("uri").nodeValue();
-            el->name = leaf.attributes().namedItem("name").nodeValue();
+            el->name = leaf.attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
             current = leaf.attributes().namedItem("current").nodeValue();
             el->playing = (0 < current.length());
             el->depth = 1;
@@ -198,7 +198,7 @@ void PlayListMainWindow::parseXmlPlayList() {
                     VlcPlayListElementSimple* it = new VlcPlayListElementSimple();
                     it->id = item.attributes().namedItem("id").nodeValue().toInt();
                     it->path = item.attributes().namedItem("uri").nodeValue();
-                    it->name = item.attributes().namedItem("name").nodeValue();
+                    it->name = item.attributes().namedItem("name").nodeValue().replace("\\\\", "\\");
                     it->extension = getExtension(it->path, NULL);
                     it->depth = 2;
                     it->type = "leaf";