From a6207f70d58da78819405caa6618ce4058321532 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 18 Dec 2009 15:13:39 +0000 Subject: [PATCH] - Fix .qbittorrent folder not being created --- src/misc.h | 5 +++++ src/torrentadditiondlg.h | 2 ++ src/transferlistfilterswidget.h | 1 + src/ui/torrentadditiondlg.ui | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/src/misc.h b/src/misc.h index 80ecf3284..0cbc41630 100644 --- a/src/misc.h +++ b/src/misc.h @@ -215,6 +215,11 @@ public: // return qBittorrent config path static QString qBittorrentPath() { QString qBtPath = QDir::homePath()+QDir::separator()+QString::fromUtf8(".qbittorrent") + QDir::separator(); + // Create dir if it does not exist + if(!QFile::exists(qBtPath)){ + QDir dir(qBtPath); + dir.mkpath(qBtPath); + } return qBtPath; } diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index 6fb1b4af3..801d1d05a 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -199,6 +199,7 @@ public: QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); settings.beginGroup(QString::fromUtf8("TransferListFilters")); QStringList customLabels = settings.value("customLabels", QStringList()).toStringList(); + comboLabel->addItem(""); foreach(const QString& label, customLabels) { comboLabel->addItem(label); } @@ -327,6 +328,7 @@ public slots: } // Save savepath TorrentTempData::setSavePath(hash, savePath.path()); + qDebug("Torrent label is: %s", comboLabel->currentText().trimmed().toLocal8Bit().data()); TorrentTempData::setLabel(hash, comboLabel->currentText().trimmed()); // Save last dir to remember it QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); diff --git a/src/transferlistfilterswidget.h b/src/transferlistfilterswidget.h index a7478d68e..a0745fbac 100644 --- a/src/transferlistfilterswidget.h +++ b/src/transferlistfilterswidget.h @@ -354,6 +354,7 @@ protected slots: --nb_labeled; } --nb_torrents; + qDebug("nb_torrents: %d, nb_labeled: %d", nb_torrents, nb_labeled); Q_ASSERT(nb_torrents >= 0); Q_ASSERT(nb_labeled >= 0); Q_ASSERT(nb_labeled <= nb_torrents); diff --git a/src/ui/torrentadditiondlg.ui b/src/ui/torrentadditiondlg.ui index 245ce30e4..f3a4ff3f5 100644 --- a/src/ui/torrentadditiondlg.ui +++ b/src/ui/torrentadditiondlg.ui @@ -145,6 +145,12 @@ + + + 180 + 0 + + 16777215