Simplify the code a bit now that QIniSettings uses qBittorrent / qBittorrent by default

This commit is contained in:
Christophe Dumez
2013-02-16 20:04:48 +02:00
parent 6c753ac183
commit da3406b811
18 changed files with 52 additions and 52 deletions

View File

@@ -62,7 +62,7 @@ TorrentImportDlg::~TorrentImportDlg()
void TorrentImportDlg::on_browseTorrentBtn_clicked()
{
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
QIniSettings settings;
const QString default_dir = settings.value(QString::fromUtf8("MainWindowLastDir"), QDir::homePath()).toString();
// Ask for a torrent file
m_torrentPath = QFileDialog::getOpenFileName(this, tr("Torrent file to import"), default_dir, tr("Torrent files (*.torrent)"));
@@ -75,7 +75,7 @@ void TorrentImportDlg::on_browseTorrentBtn_clicked()
void TorrentImportDlg::on_browseContentBtn_clicked()
{
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
QIniSettings settings;
const QString default_dir = settings.value(QString::fromUtf8("TorrentImport/LastContentDir"), QDir::homePath()).toString();
if (t->num_files() == 1) {
// Single file torrent
@@ -213,7 +213,7 @@ void TorrentImportDlg::importTorrent()
qDebug("Adding the torrent to the session...");
QBtSession::instance()->addTorrent(torrent_path);
// Remember the last opened folder
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
QIniSettings settings;
settings.setValue(QString::fromUtf8("MainWindowLastDir"), torrent_path);
settings.setValue("TorrentImport/LastContentDir", content_path);
return;
@@ -278,13 +278,13 @@ bool TorrentImportDlg::skipFileChecking() const
void TorrentImportDlg::loadSettings()
{
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
QIniSettings settings;
restoreGeometry(settings.value("TorrentImportDlg/dimensions").toByteArray());
}
void TorrentImportDlg::saveSettings()
{
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
QIniSettings settings;
settings.setValue("TorrentImportDlg/dimensions", saveGeometry());
}