mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Simplify the code a bit now that QIniSettings uses qBittorrent / qBittorrent by default
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user