Browse Source

- Fix .qbittorrent folder not being created

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
a6207f70d5
  1. 5
      src/misc.h
  2. 2
      src/torrentadditiondlg.h
  3. 1
      src/transferlistfilterswidget.h
  4. 6
      src/ui/torrentadditiondlg.ui

5
src/misc.h

@ -215,6 +215,11 @@ public: @@ -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;
}

2
src/torrentadditiondlg.h

@ -199,6 +199,7 @@ public: @@ -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: @@ -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"));

1
src/transferlistfilterswidget.h

@ -354,6 +354,7 @@ protected slots: @@ -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);

6
src/ui/torrentadditiondlg.ui

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

Loading…
Cancel
Save