summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
144ce7b)
modified: browsemainwindow.cpp
modified: playlistmainwindow.cpp
modified: playlistmainwindow.h
void BrowseMainWindow::onAddToPlaylist() {
QUrl url = QUrl("http://"+mIp+"/requests/status.xml?command=in_enqueue");
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");
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("\\", "\\\\"))));
}
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("\\", "\\\\"))));
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) {
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() {
qDebug() << code;
}
void BrowseMainWindow::readReady() {
this->parseXmlDirectory();
// only interested in finished signals
disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
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;
}
void BrowseMainWindow::parseXmlDirectory() {
QDomDocument doc;
#include "ui_playlistmainwindow.h"
#include <QPushButton>
#include <QSettings>
#include "ui_playlistmainwindow.h"
#include <QPushButton>
#include <QSettings>
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+#include <QMaemo5InformationBox>
+#endif
#include "configdialog.h"
#include "aboutdialog.h"
#include "appsettings.h"
#include "configdialog.h"
#include "aboutdialog.h"
#include "appsettings.h"
mResponse.clear();
ui->removeButton->setDisabled(true);
ui->playButton->setDisabled(true);
mResponse.clear();
ui->removeButton->setDisabled(true);
ui->playButton->setDisabled(true);
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true);
+#endif
QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/playlist.xml")));
disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
connect(reply,SIGNAL(readyRead()),this,SLOT(readReady()));
QNetworkReply * reply = mNetManager->get(QNetworkRequest(QUrl("http://"+mIp+"/requests/playlist.xml")));
disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(requestPlayList()));
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 *)));
}
connect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
}
+void PlayListMainWindow::error(QNetworkReply::NetworkError code) {
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
+#endif
+ qDebug() << code;
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
+ QMaemo5InformationBox::information(this, tr("Playlist could not be retrieved."), QMaemo5InformationBox::DefaultTimeout);
+#endif
+}
void PlayListMainWindow::readReady() {
QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
// append to buffer
void PlayListMainWindow::readReady() {
QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
// append to buffer
this->parseXmlPlayList();
// only interested in finished signals
disconnect(mNetManager,SIGNAL(finished(QNetworkReply *)),this,SLOT(finished(QNetworkReply *)));
this->parseXmlPlayList();
// 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 PlayListMainWindow::parseXmlPlayList() {
}
void PlayListMainWindow::parseXmlPlayList() {
else if ( 0 == QString::compare(el.extension, "flv") ) {
item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
}
else if ( 0 == QString::compare(el.extension, "flv") ) {
item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
}
- else if ( 0 == QString::compare(el.extension, "") ) {
- item = new QListWidgetItem(icon_unknown, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
- }
+ //else if ( 0 == QString::compare(el.extension, "") ) {
+ // item = new QListWidgetItem(icon_unknown, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id); // .flv
+ //}
else {
if (el.name.contains("Flash")) {
item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
else {
if (el.name.contains("Flash")) {
item = new QListWidgetItem(icon_flash, el.name, ui->listWidget, LIST_ITEM_TYPE_OFFSET + el.id);
void onListSelectionChanged();
void finished(QNetworkReply * reply);
void readReady();
void onListSelectionChanged();
void finished(QNetworkReply * reply);
void readReady();
+ void error(QNetworkReply::NetworkError code);
void showPlayList();
void updateUiWithCurrentStatus(VlcStatus * status);
void showPlayList();
void updateUiWithCurrentStatus(VlcStatus * status);