From 7a3af78191e1b704547268be27b20e02fed677d4 Mon Sep 17 00:00:00 2001 From: druid23 Date: Wed, 18 Aug 2010 02:29:22 +0100 Subject: [PATCH 1/1] Working basic windows file browsing modified: browsemainwindow.cpp modified: playlistmainwindow.cpp --- browsemainwindow.cpp | 5 ++++- playlistmainwindow.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/browsemainwindow.cpp b/browsemainwindow.cpp index 369464f..874c384 100644 --- a/browsemainwindow.cpp +++ b/browsemainwindow.cpp @@ -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 *))); } diff --git a/playlistmainwindow.cpp b/playlistmainwindow.cpp index fc43b99..ebe67cf 100644 --- a/playlistmainwindow.cpp +++ b/playlistmainwindow.cpp @@ -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"; -- 1.7.9.5