connect(ui->playButton,SIGNAL(clicked()),this,SLOT(onPlay()));
connect(ui->listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
+ connect(ui->actionGoUserHome, SIGNAL(triggered()), this, SLOT(showUserHomeFolder()));
connect(ui->actionGoHome, SIGNAL(triggered()), this, SLOT(showHomeFolder()));
connect(ui->actionSetHome, SIGNAL(triggered()), this, SLOT(setHomeFolder()));
connect(ui->actionViewFavourites, SIGNAL(triggered()), this, SLOT(showFavourites()));
void BrowseMainWindow::showHomeFolder() {
browseDirectory(AppSettings::getHomeDirectory().path);
}
+void BrowseMainWindow::showUserHomeFolder() {
+ browseDirectory("~/");
+}
void BrowseMainWindow::setHomeFolder() {
if (0 < mCurrentDir.length()) {
VlcDirectory dir;
}
else {
// can we browse?
- if (0 == QString::compare("directory", mCurrentElement.type)) {
+ if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
ui->browseButton->setDisabled(false);
}
else {
void BrowseMainWindow::onBrowse() {
// check for directory
- if (0 == QString::compare("directory", mCurrentElement.type)) {
+ if (0 == QString::compare("directory", mCurrentElement.type) || 0 == QString::compare("dir", mCurrentElement.type)) {
// call browseDirectory
mCurrentDir = mCurrentElement.path;
browseDirectory(mCurrentDir);
#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
this->setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
#endif
+ delete reply;
}
void BrowseMainWindow::parseXmlDirectory() {
QDomDocument doc;
dir->name = node.attributes().namedItem("name").nodeValue();
dir->extension = getExtension(dir->path, node.attributes().namedItem("extension").nodeValue());
++idx;
- if (0 != QString::compare("directory", dir->type)) {
+ if (0 != QString::compare("directory", dir->type) && 0 != QString::compare("dir", dir->type)) {
files->append(*dir);
}
else if (0 == QString::compare("..", dir->name)) {
}
}
-void BrowseMainWindow::writeFile(QString path, QByteArray text) {
- QFile file(path);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- return;
-
- QTextStream out(&file);
- out << text;
-}
-
void BrowseMainWindow::updateList() {
ui->listWidget->clear();
int ct = this->mContents->count();
VlcBrowseElement dir = mContents->at(idx);
QListWidgetItem* item;
bool item_good = false;
- if (0 == QString::compare("directory", dir.type)) {
+ if (0 == QString::compare("directory", dir.type) || 0 == QString::compare("dir", dir.type)) {
if (0 == QString::compare("..", dir.name)) {
item = new QListWidgetItem(icon_up, dir.name, ui->listWidget, 0);
item_good = true;