diff --git a/src/addnewtorrentdialog.cpp b/src/addnewtorrentdialog.cpp index 6500c27a6..52668ac10 100644 --- a/src/addnewtorrentdialog.cpp +++ b/src/addnewtorrentdialog.cpp @@ -62,7 +62,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(QWidget *parent) : { ui->setupUi(this); - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; Preferences pref; ui->start_torrent_cb->setChecked(!pref.addTorrentsInPause()); ui->save_path_combo->addItem(fsutils::toDisplayPath(pref.getSavePath()), pref.getSavePath()); @@ -93,7 +93,7 @@ AddNewTorrentDialog::~AddNewTorrentDialog() void AddNewTorrentDialog::loadState() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog")); QByteArray state = settings.value("treeHeaderState").toByteArray(); if (!state.isEmpty()) @@ -109,7 +109,7 @@ void AddNewTorrentDialog::loadState() void AddNewTorrentDialog::saveState() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.beginGroup(QString::fromUtf8("AddNewTorrentDialog")); if (m_contentModel) settings.setValue("treeHeaderState", ui->content_tree->header()->saveState()); @@ -229,7 +229,7 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString } } - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; showAdvancedSettings(settings.value("AddNewTorrentDialog/expanded").toBool()); // Set dialog position setdialogPosition(); @@ -251,7 +251,7 @@ bool AddNewTorrentDialog::loadMagnet(const QString &magnet_uri) QString torrent_name = misc::magnetUriToName(m_url); setWindowTitle(torrent_name.isEmpty() ? tr("Magnet link") : torrent_name); - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; showAdvancedSettings(settings.value("AddNewTorrentDialog/expanded").toBool()); // Set dialog position setdialogPosition(); @@ -262,7 +262,7 @@ bool AddNewTorrentDialog::loadMagnet(const QString &magnet_uri) void AddNewTorrentDialog::saveSavePathHistory() const { QDir selected_save_path(ui->save_path_combo->itemData(ui->save_path_combo->currentIndex()).toString()); - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; // Get current history QStringList history = settings.value("TorrentAdditionDlg/save_path_history").toStringList(); QList history_dirs; @@ -488,7 +488,7 @@ void AddNewTorrentDialog::setdialogPosition() qApp->processEvents(); QPoint center(misc::screenCenter(this)); // Adjust y - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; int y = settings.value("AddNewTorrentDialog/y", -1).toInt(); if (y >= 0) { center.setY(y); @@ -502,7 +502,7 @@ void AddNewTorrentDialog::setdialogPosition() void AddNewTorrentDialog::loadSavePathHistory() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; QDir default_save_path(Preferences().getSavePath()); // Load save path history QStringList raw_path_history = settings.value("TorrentAdditionDlg/save_path_history").toStringList(); diff --git a/src/dnsupdater.cpp b/src/dnsupdater.cpp index 35f0da777..896b004c5 100644 --- a/src/dnsupdater.cpp +++ b/src/dnsupdater.cpp @@ -40,7 +40,7 @@ DNSUpdater::DNSUpdater(QObject *parent) : updateCredentials(); // Load saved settings from previous session - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; m_lastIPCheckTime = settings.value("DNSUpdater/lastUpdateTime").toDateTime(); m_lastIP = QHostAddress(settings.value("DNSUpdater/lastIP").toString()); @@ -58,7 +58,7 @@ DNSUpdater::DNSUpdater(QObject *parent) : DNSUpdater::~DNSUpdater() { // Save lastupdate time and last ip - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.setValue("DNSUpdater/lastUpdateTime", m_lastIPCheckTime); settings.setValue("DNSUpdater/lastIP", m_lastIP.toString()); } diff --git a/src/main.cpp b/src/main.cpp index bcc4c198a..d381cc3ac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -98,7 +98,7 @@ class LegalNotice: public QObject { public: static bool userAgreesWithNotice() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; if (settings.value(QString::fromUtf8("LegalNotice/Accepted"), false).toBool()) // Already accepted once return true; #ifdef DISABLE_GUI diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b2cc23819..707aa8b83 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -491,7 +491,7 @@ void MainWindow::tab_changed(int new_tab) { } void MainWindow::writeSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.beginGroup(QString::fromUtf8("MainWindow")); settings.setValue("geometry", saveGeometry()); // Splitter size @@ -501,7 +501,7 @@ void MainWindow::writeSettings() { } void MainWindow::readSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.beginGroup(QString::fromUtf8("MainWindow")); if (settings.contains("geometry")) { if (restoreGeometry(settings.value("geometry").toByteArray())) @@ -922,7 +922,7 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event) { // torrents to download list void MainWindow::on_actionOpen_triggered() { Preferences pref; - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; // Open File Open Dialog // Note: it is possible to select more than one file const QStringList pathsList = QFileDialog::getOpenFileNames(0, @@ -1172,7 +1172,7 @@ void MainWindow::showNotificationBaloon(QString title, QString msg) const { *****************************************************/ void MainWindow::downloadFromURLList(const QStringList& url_list) { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; const bool useTorrentAdditionDialog = settings.value(QString::fromUtf8("Preferences/Downloads/AdditionDialog"), true).toBool(); foreach (QString url, url_list) { if (url.startsWith("bc://bt/", Qt::CaseInsensitive)) { diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index 4395ff03f..d926638b4 100755 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -300,7 +300,7 @@ void options_imp::changePage(QListWidgetItem *current, QListWidgetItem *previous } void options_imp::loadWindowState() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; resize(settings.value(QString::fromUtf8("Preferences/State/size"), sizeFittingScreen()).toSize()); QPoint p = settings.value(QString::fromUtf8("Preferences/State/pos"), QPoint()).toPoint(); if (!p.isNull()) @@ -320,7 +320,7 @@ void options_imp::loadWindowState() { } void options_imp::saveWindowState() const { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue(QString::fromUtf8("Preferences/State/size"), size()); settings.setValue(QString::fromUtf8("Preferences/State/pos"), pos()); // Splitter size diff --git a/src/properties/peerlistwidget.cpp b/src/properties/peerlistwidget.cpp index 6becc9774..cf9986971 100644 --- a/src/properties/peerlistwidget.cpp +++ b/src/properties/peerlistwidget.cpp @@ -295,12 +295,12 @@ void PeerListWidget::clear() { } void PeerListWidget::loadSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; header()->restoreState(settings.value("TorrentProperties/Peers/PeerListState").toByteArray()); } void PeerListWidget::saveSettings() const { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue("TorrentProperties/Peers/PeerListState", header()->saveState()); } diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index 30e6b3df7..391d85fbf 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -268,7 +268,7 @@ void PropertiesWidget::loadTorrentInfos(const QTorrentHandle& _h) } void PropertiesWidget::readSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; // Restore splitter sizes QStringList sizes_str = settings.value(QString::fromUtf8("TorrentProperties/SplitterSizes"), QString()).toString().split(","); if (sizes_str.size() == 2) { @@ -288,7 +288,7 @@ void PropertiesWidget::readSettings() { } void PropertiesWidget::saveSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue("TorrentProperties/Visible", state==VISIBLE); // Splitter sizes QSplitter *hSplitter = static_cast(parentWidget()); diff --git a/src/properties/trackerlist.cpp b/src/properties/trackerlist.cpp index 8464e314e..c1532b005 100644 --- a/src/properties/trackerlist.cpp +++ b/src/properties/trackerlist.cpp @@ -440,7 +440,7 @@ void TrackerList::showTrackerListMenu(QPoint) { } void TrackerList::loadSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; if (!header()->restoreState(settings.value("TorrentProperties/Trackers/TrackerListState").toByteArray())) { setColumnWidth(0, 30); setColumnWidth(1, 300); @@ -448,6 +448,6 @@ void TrackerList::loadSettings() { } void TrackerList::saveSettings() const { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue("TorrentProperties/Trackers/TrackerListState", header()->saveState()); } diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 3872c0245..260670e2b 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -2790,7 +2790,7 @@ void QBtSession::startUpTorrents() { addTorrent(torrentBackup.path()+QDir::separator()+hash+".torrent", false, QString(), true); } } - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.setValue("ported_to_new_savepath_system", true); qDebug("Unfinished torrents resumed"); } diff --git a/src/rss/automatedrssdownloader.cpp b/src/rss/automatedrssdownloader.cpp index 94bb30107..838e0d438 100644 --- a/src/rss/automatedrssdownloader.cpp +++ b/src/rss/automatedrssdownloader.cpp @@ -108,7 +108,7 @@ AutomatedRssDownloader::~AutomatedRssDownloader() void AutomatedRssDownloader::loadSettings() { // load dialog geometry - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; restoreGeometry(settings.value("RssFeedDownloader/geometry").toByteArray()); ui->checkEnableDownloader->setChecked(RssSettings().isRssDownloadingEnabled()); ui->hsplitter->restoreState(settings.value("RssFeedDownloader/hsplitterSizes").toByteArray()); @@ -120,7 +120,7 @@ void AutomatedRssDownloader::saveSettings() { RssSettings().setRssDownloadingEnabled(ui->checkEnableDownloader->isChecked()); // Save dialog geometry - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.setValue("RssFeedDownloader/geometry", saveGeometry()); settings.setValue("RssFeedDownloader/hsplitterSizes", ui->hsplitter->saveState()); } diff --git a/src/rss/rss_imp.cpp b/src/rss/rss_imp.cpp index 48c5f10cb..0a431f14d 100644 --- a/src/rss/rss_imp.cpp +++ b/src/rss/rss_imp.cpp @@ -281,7 +281,7 @@ void RSSImp::deleteSelectedItems() void RSSImp::loadFoldersOpenState() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.beginGroup("Rss"); QStringList open_folders = settings.value("open_folders", QStringList()).toStringList(); settings.endGroup(); @@ -320,7 +320,7 @@ void RSSImp::saveFoldersOpenState() qDebug("saving open folder: %s", qPrintable(path)); open_folders << path; } - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.beginGroup("Rss"); settings.setValue("open_folders", open_folders); settings.endGroup(); @@ -578,7 +578,7 @@ void RSSImp::refreshTextBrowser() void RSSImp::saveSlidersPosition() { // Remember sliders positions - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.setValue("rss/splitter_h", splitter_h->saveState()); settings.setValue("rss/splitter_v", splitter_v->saveState()); qDebug("Splitters position saved"); @@ -586,7 +586,7 @@ void RSSImp::saveSlidersPosition() void RSSImp::restoreSlidersPosition() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QByteArray pos_h = settings.value("rss/splitter_h", QByteArray()).toByteArray(); if (!pos_h.isNull()) { splitter_h->restoreState(pos_h); diff --git a/src/searchengine/searchengine.cpp b/src/searchengine/searchengine.cpp index ea144080c..7a2228b33 100644 --- a/src/searchengine/searchengine.cpp +++ b/src/searchengine/searchengine.cpp @@ -301,7 +301,7 @@ void SearchEngine::propagateSectionResized(int index, int , int newsize) { void SearchEngine::saveResultsColumnsWidth() { if (all_tab.size() > 0) { QTreeView* treeview = all_tab.first()->getCurrentTreeView(); - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QStringList width_list; QStringList new_width_list; short nbColumns = all_tab.first()->getCurrentSearchListModel()->columnCount(); @@ -486,7 +486,7 @@ void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus) { if (searchTimeout->isActive()) { searchTimeout->stop(); } - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; bool useNotificationBalloons = settings.value("Preferences/General/NotificationBaloons", true).toBool(); if (useNotificationBalloons && mp_mainWindow->getCurrentTabWidget() != this) { mp_mainWindow->showNotificationBaloon(tr("Search Engine"), tr("Search has finished")); diff --git a/src/searchengine/searchtab.cpp b/src/searchengine/searchtab.cpp index 097b0831a..cc6a96d97 100644 --- a/src/searchengine/searchtab.cpp +++ b/src/searchengine/searchtab.cpp @@ -106,7 +106,7 @@ QHeaderView* SearchTab::header() const { } bool SearchTab::loadColWidthResultsList() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QString line = settings.value("SearchResultsColsWidth", QString()).toString(); if (line.isEmpty()) return false; diff --git a/src/searchengine/supportedengines.h b/src/searchengine/supportedengines.h index b3131b4d7..5d012df58 100644 --- a/src/searchengine/supportedengines.h +++ b/src/searchengine/supportedengines.h @@ -75,7 +75,7 @@ public: full_name = engine_elem.elementsByTagName("name").at(0).toElement().text(); url = engine_elem.elementsByTagName("url").at(0).toElement().text(); supported_categories = engine_elem.elementsByTagName("categories").at(0).toElement().text().split(" "); - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; QStringList disabled_engines = settings.value(QString::fromUtf8("SearchEngines/disabledEngines"), QStringList()).toStringList(); enabled = !disabled_engines.contains(name); } @@ -88,7 +88,7 @@ public: void setEnabled(bool _enabled) { enabled = _enabled; // Save to Hard disk - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; QStringList disabled_engines = settings.value(QString::fromUtf8("SearchEngines/disabledEngines"), QStringList()).toStringList(); if (enabled) { disabled_engines.removeAll(name); diff --git a/src/torrentcreator/torrentcreatordlg.cpp b/src/torrentcreator/torrentcreatordlg.cpp index 02cd856cb..68f84f2ad 100644 --- a/src/torrentcreator/torrentcreatordlg.cpp +++ b/src/torrentcreator/torrentcreatordlg.cpp @@ -69,7 +69,7 @@ TorrentCreatorDlg::~TorrentCreatorDlg() { } void TorrentCreatorDlg::on_addFolder_button_clicked() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString(); QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), last_path, QFileDialog::ShowDirsOnly); if (!dir.isEmpty()) { @@ -85,7 +85,7 @@ void TorrentCreatorDlg::on_addFolder_button_clicked() { } void TorrentCreatorDlg::on_addFile_button_clicked() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString(); QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), last_path); if (!file.isEmpty()) { @@ -117,7 +117,7 @@ void TorrentCreatorDlg::on_createButton_clicked() { if (!trackers_list->toPlainText().trimmed().isEmpty()) saveTrackerList(); - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; QString last_path = settings.value("CreateTorrent/last_save_path", QDir::homePath()).toString(); QString destination = QFileDialog::getSaveFileName(this, tr("Select destination torrent file"), last_path, tr("Torrent Files")+QString::fromUtf8(" (*.torrent)")); @@ -246,25 +246,25 @@ void TorrentCreatorDlg::updateOptimalPieceSize() void TorrentCreatorDlg::saveTrackerList() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue("CreateTorrent/TrackerList", trackers_list->toPlainText()); } void TorrentCreatorDlg::loadTrackerList() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; trackers_list->setPlainText(settings.value("CreateTorrent/TrackerList", "").toString()); } void TorrentCreatorDlg::saveSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.setValue("CreateTorrent/dimensions", saveGeometry()); } void TorrentCreatorDlg::loadSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; restoreGeometry(settings.value("CreateTorrent/dimensions").toByteArray()); } diff --git a/src/torrentimportdlg.cpp b/src/torrentimportdlg.cpp index 087eba593..f7069c019 100644 --- a/src/torrentimportdlg.cpp +++ b/src/torrentimportdlg.cpp @@ -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()); } diff --git a/src/transferlistfilterswidget.h b/src/transferlistfilterswidget.h index 39465ebca..8a66462a7 100644 --- a/src/transferlistfilterswidget.h +++ b/src/transferlistfilterswidget.h @@ -281,7 +281,7 @@ public: } void saveSettings() const { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; settings.beginGroup(QString::fromUtf8("TransferListFilters")); settings.setValue("selectedFilterIndex", QVariant(statusFilters->currentRow())); //settings.setValue("selectedLabelIndex", QVariant(labelFilters->currentRow())); @@ -289,7 +289,7 @@ public: } void loadSettings() { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; statusFilters->setCurrentRow(settings.value("TransferListFilters/selectedFilterIndex", 0).toInt()); const QStringList label_list = Preferences().getTorrentLabels(); foreach (const QString &label, label_list) { diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index f534e94b3..661277076 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -185,7 +185,7 @@ inline QModelIndex TransferListWidget::mapFromSource(const QModelIndex &index) c QStringList TransferListWidget::getCustomLabels() const { - QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); + QIniSettings settings; return settings.value("TransferListFilters/customLabels", QStringList()).toStringList(); } @@ -900,13 +900,13 @@ void TransferListWidget::applyStatusFilter(int f) { void TransferListWidget::saveSettings() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; settings.setValue("TransferList/HeaderState", header()->saveState()); } bool TransferListWidget::loadSettings() { - QIniSettings settings("qBittorrent", "qBittorrent"); + QIniSettings settings; bool ok = header()->restoreState(settings.value("TransferList/HeaderState").toByteArray()); if (!ok) { header()->resizeSection(0, 200); // Default