Skip to content
Permalink
Browse files

Fix path in skin selection dialog

* Open skin selection dialog with sane path
** if empty
*** installation dir on windows
*** data dir on linux
*** in skins subfolder, if it exists
** Use currently set path if set
  • Loading branch information...
Kissaki committed Aug 19, 2013
1 parent 2864eee commit 6e09508e7aa142bad35106837f73f7d0c21faaf5
Showing with 20 additions and 1 deletion.
  1. +20 −1 src/mumble/LookConfig.cpp
@@ -213,7 +213,26 @@ bool LookConfig::expert(bool b) {
}

void LookConfig::on_qpbSkinFile_clicked(bool) {
QString file = QFileDialog::getOpenFileName(this, tr("Choose skin file"), QString(), QLatin1String("*.qss"));
QString currentPath(qleCSS->text());
if (currentPath.isEmpty()) {
QDir p;
#if defined(Q_OS_WIN)
p.setPath(QApplication::applicationDirPath());
#else
p = g.qdBasePath;
#endif
currentPath = p.path();

p.cd(QString::fromLatin1("skins"));
if (p.exists() && p.isReadable()) {
currentPath = p.path();
}
}
QDir path(currentPath);
if (!path.exists() || !path.isReadable()) {
path.cdUp();
}
QString file = QFileDialog::getOpenFileName(this, tr("Choose skin file"), path.path(), QLatin1String("*.qss"));
if (! file.isEmpty()) {
qleCSS->setText(file);
}

0 comments on commit 6e09508

Please sign in to comment.
You can’t perform that action at this time.