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:
// 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;
} }

2
src/torrentadditiondlg.h

@ -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"));

1
src/transferlistfilterswidget.h

@ -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);

6
src/ui/torrentadditiondlg.ui

@ -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>

Loading…
Cancel
Save