1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

- Fix .qbittorrent folder not being created

This commit is contained in:
Christophe Dumez 2009-12-18 15:13:39 +00:00
parent b8a30be7bc
commit a6207f70d5
4 changed files with 14 additions and 0 deletions

View File

@ -215,6 +215,11 @@ public:
// return qBittorrent config path // return qBittorrent config path
static QString qBittorrentPath() { static QString qBittorrentPath() {
QString qBtPath = QDir::homePath()+QDir::separator()+QString::fromUtf8(".qbittorrent") + QDir::separator(); 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; return qBtPath;
} }

View File

@ -199,6 +199,7 @@ public:
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
settings.beginGroup(QString::fromUtf8("TransferListFilters")); settings.beginGroup(QString::fromUtf8("TransferListFilters"));
QStringList customLabels = settings.value("customLabels", QStringList()).toStringList(); QStringList customLabels = settings.value("customLabels", QStringList()).toStringList();
comboLabel->addItem("");
foreach(const QString& label, customLabels) { foreach(const QString& label, customLabels) {
comboLabel->addItem(label); comboLabel->addItem(label);
} }
@ -327,6 +328,7 @@ public slots:
} }
// Save savepath // Save savepath
TorrentTempData::setSavePath(hash, savePath.path()); TorrentTempData::setSavePath(hash, savePath.path());
qDebug("Torrent label is: %s", comboLabel->currentText().trimmed().toLocal8Bit().data());
TorrentTempData::setLabel(hash, comboLabel->currentText().trimmed()); TorrentTempData::setLabel(hash, comboLabel->currentText().trimmed());
// Save last dir to remember it // Save last dir to remember it
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));

View File

@ -354,6 +354,7 @@ protected slots:
--nb_labeled; --nb_labeled;
} }
--nb_torrents; --nb_torrents;
qDebug("nb_torrents: %d, nb_labeled: %d", nb_torrents, nb_labeled);
Q_ASSERT(nb_torrents >= 0); Q_ASSERT(nb_torrents >= 0);
Q_ASSERT(nb_labeled >= 0); Q_ASSERT(nb_labeled >= 0);
Q_ASSERT(nb_labeled <= nb_torrents); Q_ASSERT(nb_labeled <= nb_torrents);

View File

@ -145,6 +145,12 @@
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboLabel"> <widget class="QComboBox" name="comboLabel">
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>