Refactoring.
This commit is contained in:
parent
31cd7d5b01
commit
dbdddb8729
15 changed files with 46 additions and 73 deletions
|
@ -47,7 +47,7 @@ void FormAbout::loadSettingsAndPaths() {
|
||||||
m_ui.m_txtPathsSettingsType->setText(tr("NOT portable"));
|
m_ui.m_txtPathsSettingsType->setText(tr("NOT portable"));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui.m_txtPathsDatabaseRoot->setText(QDir::toNativeSeparators(qApp->userDataPath() +
|
m_ui.m_txtPathsDatabaseRoot->setText(QDir::toNativeSeparators(qApp->userDataFolder() +
|
||||||
QDir::separator() +
|
QDir::separator() +
|
||||||
QString(APP_DB_SQLITE_PATH)));
|
QString(APP_DB_SQLITE_PATH)));
|
||||||
m_ui.m_txtPathsSettingsFile->setText(QDir::toNativeSeparators(qApp->settings()->fileName()));
|
m_ui.m_txtPathsSettingsFile->setText(QDir::toNativeSeparators(qApp->settings()->fileName()));
|
||||||
|
|
|
@ -39,7 +39,7 @@ FormBackupDatabaseSettings::FormBackupDatabaseSettings(QWidget* parent) : QDialo
|
||||||
connect(m_ui->m_txtBackupName->lineEdit(), &BaseLineEdit::textChanged, this, &FormBackupDatabaseSettings::checkBackupNames);
|
connect(m_ui->m_txtBackupName->lineEdit(), &BaseLineEdit::textChanged, this, &FormBackupDatabaseSettings::checkBackupNames);
|
||||||
connect(m_ui->m_txtBackupName->lineEdit(), &BaseLineEdit::textChanged, this, &FormBackupDatabaseSettings::checkOkButton);
|
connect(m_ui->m_txtBackupName->lineEdit(), &BaseLineEdit::textChanged, this, &FormBackupDatabaseSettings::checkOkButton);
|
||||||
connect(m_ui->m_btnSelectFolder, &QPushButton::clicked, this, &FormBackupDatabaseSettings::selectFolderInitial);
|
connect(m_ui->m_btnSelectFolder, &QPushButton::clicked, this, &FormBackupDatabaseSettings::selectFolderInitial);
|
||||||
selectFolder(qApp->getDocumentsFolderPath());
|
selectFolder(qApp->documentsFolder());
|
||||||
m_ui->m_txtBackupName->lineEdit()->setText(QString(APP_LOW_NAME) + QL1S("_") + QDateTime::currentDateTime().toString(QSL("yyyyMMddHHmm")));
|
m_ui->m_txtBackupName->lineEdit()->setText(QString(APP_LOW_NAME) + QL1S("_") + QDateTime::currentDateTime().toString(QSL("yyyyMMddHHmm")));
|
||||||
m_ui->m_lblResult->setStatus(WidgetWithStatus::Warning, tr("No operation executed yet."), tr("No operation executed yet."));
|
m_ui->m_lblResult->setStatus(WidgetWithStatus::Warning, tr("No operation executed yet."), tr("No operation executed yet."));
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ FormRestoreDatabaseSettings::FormRestoreDatabaseSettings(QWidget& parent)
|
||||||
connect(m_ui.m_groupDatabase, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
|
connect(m_ui.m_groupDatabase, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
|
||||||
connect(m_ui.m_groupSettings, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
|
connect(m_ui.m_groupSettings, SIGNAL(toggled(bool)), this, SLOT(checkOkButton()));
|
||||||
connect(m_ui.m_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(performRestoration()));
|
connect(m_ui.m_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(performRestoration()));
|
||||||
selectFolder(qApp->getDocumentsFolderPath());
|
selectFolder(qApp->documentsFolder());
|
||||||
}
|
}
|
||||||
|
|
||||||
FormRestoreDatabaseSettings::~FormRestoreDatabaseSettings() {
|
FormRestoreDatabaseSettings::~FormRestoreDatabaseSettings() {
|
||||||
|
|
|
@ -129,7 +129,7 @@ void FormUpdate::updateProgress(qint64 bytes_received, qint64 bytes_total) {
|
||||||
|
|
||||||
void FormUpdate::saveUpdateFile(const QByteArray& file_contents) {
|
void FormUpdate::saveUpdateFile(const QByteArray& file_contents) {
|
||||||
const QString url_file = m_ui.m_listFiles->currentItem()->data(Qt::UserRole).toString();
|
const QString url_file = m_ui.m_listFiles->currentItem()->data(Qt::UserRole).toString();
|
||||||
const QString temp_directory = qApp->getTempFolderPath();
|
const QString temp_directory = qApp->tempFolder();
|
||||||
|
|
||||||
if (!temp_directory.isEmpty()) {
|
if (!temp_directory.isEmpty()) {
|
||||||
const QString output_file_name = url_file.mid(url_file.lastIndexOf('/') + 1);
|
const QString output_file_name = url_file.mid(url_file.lastIndexOf('/') + 1);
|
||||||
|
|
|
@ -73,7 +73,7 @@ void SettingsBrowserMail::changeDefaultBrowserArguments(int index) {
|
||||||
void SettingsBrowserMail::selectBrowserExecutable() {
|
void SettingsBrowserMail::selectBrowserExecutable() {
|
||||||
const QString executable_file = QFileDialog::getOpenFileName(this,
|
const QString executable_file = QFileDialog::getOpenFileName(this,
|
||||||
tr("Select web browser executable"),
|
tr("Select web browser executable"),
|
||||||
qApp->getHomeFolderPath(),
|
qApp->homeFolder(),
|
||||||
//: File filter for external browser selection dialog.
|
//: File filter for external browser selection dialog.
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
tr("Executables (*)"));
|
tr("Executables (*)"));
|
||||||
|
@ -119,7 +119,7 @@ void SettingsBrowserMail::changeDefaultEmailArguments(int index) {
|
||||||
void SettingsBrowserMail::selectEmailExecutable() {
|
void SettingsBrowserMail::selectEmailExecutable() {
|
||||||
QString executable_file = QFileDialog::getOpenFileName(this,
|
QString executable_file = QFileDialog::getOpenFileName(this,
|
||||||
tr("Select e-mail executable"),
|
tr("Select e-mail executable"),
|
||||||
qApp->getHomeFolderPath(),
|
qApp->homeFolder(),
|
||||||
//: File filter for external e-mail selection dialog.
|
//: File filter for external e-mail selection dialog.
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
tr("Executables (*)"));
|
tr("Executables (*)"));
|
||||||
|
|
|
@ -59,21 +59,23 @@ Application::Application(const QString& id, int& argc, char** argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_feedReader(nullptr),
|
m_feedReader(nullptr),
|
||||||
m_updateFeedsLock(nullptr), m_userActions(QList<QAction*>()), m_mainForm(nullptr),
|
m_updateFeedsLock(new Mutex()), m_userActions(QList<QAction*>()), m_mainForm(nullptr),
|
||||||
m_trayIcon(nullptr), m_settings(nullptr), m_webFactory(new WebFactory(this)), m_system(nullptr), m_skins(nullptr),
|
m_trayIcon(nullptr), m_settings(Settings::setupSettings(this)), m_webFactory(new WebFactory(this)),
|
||||||
m_localization(nullptr), m_icons(nullptr), m_database(nullptr), m_downloadManager(nullptr), m_shouldRestart(false) {
|
m_system(new SystemFactory(this)), m_skins(new SkinFactory(this)),
|
||||||
|
m_localization(new Localization(this)), m_icons(new IconFactory(this)),
|
||||||
|
m_database(new DatabaseFactory(this)), m_downloadManager(nullptr), m_shouldRestart(false) {
|
||||||
connect(this, &Application::aboutToQuit, this, &Application::onAboutToQuit);
|
connect(this, &Application::aboutToQuit, this, &Application::onAboutToQuit);
|
||||||
connect(this, &Application::commitDataRequest, this, &Application::onCommitData);
|
connect(this, &Application::commitDataRequest, this, &Application::onCommitData);
|
||||||
connect(this, &Application::saveStateRequest, this, &Application::onSaveState);
|
connect(this, &Application::saveStateRequest, this, &Application::onSaveState);
|
||||||
|
|
||||||
#if defined(USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested);
|
connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested);
|
||||||
|
|
||||||
QWebEngineProfile::defaultProfile()->setRequestInterceptor(m_urlInterceptor);
|
QWebEngineProfile::defaultProfile()->setRequestInterceptor(m_urlInterceptor);
|
||||||
// TODO: Call load settings when saving app settings from dialog.
|
|
||||||
// Will need add that if I add more settings in the future.
|
|
||||||
m_urlInterceptor->loadSettings();
|
m_urlInterceptor->loadSettings();
|
||||||
QWebEngineProfile::defaultProfile()->installUrlSchemeHandler(
|
QWebEngineProfile::defaultProfile()->installUrlSchemeHandler(
|
||||||
QByteArray(APP_LOW_NAME),
|
QByteArray(APP_LOW_NAME),
|
||||||
new RssGuardSchemeHandler(QWebEngineProfile::defaultProfile()));
|
new RssGuardSchemeHandler(QWebEngineProfile::defaultProfile()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +90,7 @@ FeedReader* Application::feedReader() {
|
||||||
QList<QAction*> Application::userActions() {
|
QList<QAction*> Application::userActions() {
|
||||||
if (m_mainForm != nullptr && m_userActions.isEmpty()) {
|
if (m_mainForm != nullptr && m_userActions.isEmpty()) {
|
||||||
m_userActions = m_mainForm->allActions();
|
m_userActions = m_mainForm->allActions();
|
||||||
|
|
||||||
#if defined(USE_WEBENGINE)
|
#if defined(USE_WEBENGINE)
|
||||||
m_userActions.append(AdBlockManager::instance()->adBlockIcon());
|
m_userActions.append(AdBlockManager::instance()->adBlockIcon());
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,34 +118,18 @@ WebFactory* Application::web() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFactory* Application::system() {
|
SystemFactory* Application::system() {
|
||||||
if (m_system == nullptr) {
|
|
||||||
m_system = new SystemFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_system;
|
return m_system;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkinFactory* Application::skins() {
|
SkinFactory* Application::skins() {
|
||||||
if (m_skins == nullptr) {
|
|
||||||
m_skins = new SkinFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_skins;
|
return m_skins;
|
||||||
}
|
}
|
||||||
|
|
||||||
Localization* Application::localization() {
|
Localization* Application::localization() {
|
||||||
if (m_localization == nullptr) {
|
|
||||||
m_localization = new Localization(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_localization;
|
return m_localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
DatabaseFactory* Application::database() {
|
DatabaseFactory* Application::database() {
|
||||||
if (m_database == nullptr) {
|
|
||||||
m_database = new DatabaseFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_database;
|
return m_database;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,10 +149,6 @@ void Application::setFeedReader(FeedReader* feed_reader) {
|
||||||
}
|
}
|
||||||
|
|
||||||
IconFactory* Application::icons() {
|
IconFactory* Application::icons() {
|
||||||
if (m_icons == nullptr) {
|
|
||||||
m_icons = new IconFactory(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_icons;
|
return m_icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,20 +163,10 @@ DownloadManager* Application::downloadManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings* Application::settings() {
|
Settings* Application::settings() {
|
||||||
if (m_settings == nullptr) {
|
|
||||||
m_settings = Settings::setupSettings(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_settings;
|
return m_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mutex* Application::feedUpdateLock() {
|
Mutex* Application::feedUpdateLock() {
|
||||||
if (m_updateFeedsLock.isNull()) {
|
|
||||||
// NOTE: Cannot use parent hierarchy because this method can be usually called
|
|
||||||
// from any thread.
|
|
||||||
m_updateFeedsLock.reset(new Mutex());
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_updateFeedsLock.data();
|
return m_updateFeedsLock.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,46 +182,46 @@ void Application::setMainForm(FormMain* main_form) {
|
||||||
m_mainForm = main_form;
|
m_mainForm = main_form;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getConfigHomePath() {
|
QString Application::configFolder() {
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::GenericConfigLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::GenericConfigLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getUserDataAppPath() {
|
QString Application::userDataAppFolder() {
|
||||||
// In "app" folder, we would like to separate all user data into own subfolder,
|
// In "app" folder, we would like to separate all user data into own subfolder,
|
||||||
// therefore stick to "data" folder in this mode.
|
// therefore stick to "data" folder in this mode.
|
||||||
return applicationDirPath() + QDir::separator() + QSL("data");
|
return applicationDirPath() + QDir::separator() + QSL("data");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::userDataPath() {
|
QString Application::userDataFolder() {
|
||||||
if (settings()->type() == SettingsProperties::Portable) {
|
if (settings()->type() == SettingsProperties::Portable) {
|
||||||
return getUserDataAppPath();
|
return userDataAppFolder();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return getUserDataHomePath();
|
return userDataHomeFolder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getUserDataHomePath() {
|
QString Application::userDataHomeFolder() {
|
||||||
// Fallback folder.
|
// Fallback folder.
|
||||||
const QString home_folder = getHomeFolderPath() + QDir::separator() + QSL(APP_LOW_H_NAME) + QDir::separator() + QSL("data");
|
const QString home_folder = homeFolder() + QDir::separator() + QSL(APP_LOW_H_NAME) + QDir::separator() + QSL("data");
|
||||||
|
|
||||||
if (QDir().exists(home_folder)) {
|
if (QDir().exists(home_folder)) {
|
||||||
return home_folder;
|
return home_folder;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return getConfigHomePath() + QDir::separator() + QSL(APP_NAME);
|
return configFolder() + QDir::separator() + QSL(APP_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getTempFolderPath() {
|
QString Application::tempFolder() {
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::TempLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::TempLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getDocumentsFolderPath() {
|
QString Application::documentsFolder() {
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::DocumentsLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::DocumentsLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Application::getHomeFolderPath() {
|
QString Application::homeFolder() {
|
||||||
return IOFactory::getSystemFolder(QStandardPaths::HomeLocation);
|
return IOFactory::getSystemFolder(QStandardPaths::HomeLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,18 +92,18 @@ class Application : public QtSingleApplication {
|
||||||
NetworkUrlInterceptor* urlIinterceptor();
|
NetworkUrlInterceptor* urlIinterceptor();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString getTempFolderPath();
|
QString tempFolder();
|
||||||
QString getDocumentsFolderPath();
|
QString documentsFolder();
|
||||||
QString getHomeFolderPath();
|
QString homeFolder();
|
||||||
QString getConfigHomePath();
|
QString configFolder();
|
||||||
|
|
||||||
// These return user ready folders.
|
// These return user ready folders.
|
||||||
QString getUserDataAppPath();
|
QString userDataAppFolder();
|
||||||
QString getUserDataHomePath();
|
QString userDataHomeFolder();
|
||||||
|
|
||||||
// Returns the base folder to which store user data, the "data" folder.
|
// Returns the base folder to which store user data, the "data" folder.
|
||||||
// NOTE: Use this to get correct path under which store user data.
|
// NOTE: Use this to get correct path under which store user data.
|
||||||
QString userDataPath();
|
QString userDataFolder();
|
||||||
|
|
||||||
void setMainForm(FormMain* main_form);
|
void setMainForm(FormMain* main_form);
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ void DatabaseFactory::finishRestoration() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseFactory::sqliteAssemblyDatabaseFilePath() {
|
void DatabaseFactory::sqliteAssemblyDatabaseFilePath() {
|
||||||
m_sqliteDatabaseFilePath = qApp->userDataPath() + QDir::separator() + QString(APP_DB_SQLITE_PATH);
|
m_sqliteDatabaseFilePath = qApp->userDataFolder() + QDir::separator() + QString(APP_DB_SQLITE_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSqlDatabase DatabaseFactory::sqliteInitializeInMemoryDatabase() {
|
QSqlDatabase DatabaseFactory::sqliteInitializeInMemoryDatabase() {
|
||||||
|
|
|
@ -354,8 +354,8 @@ Settings* Settings::setupSettings(QObject* parent) {
|
||||||
SettingsProperties Settings::determineProperties() {
|
SettingsProperties Settings::determineProperties() {
|
||||||
SettingsProperties properties;
|
SettingsProperties properties;
|
||||||
properties.m_settingsSuffix = QDir::separator() + QSL(APP_CFG_PATH) + QDir::separator() + QSL(APP_CFG_FILE);
|
properties.m_settingsSuffix = QDir::separator() + QSL(APP_CFG_PATH) + QDir::separator() + QSL(APP_CFG_FILE);
|
||||||
const QString app_path = qApp->getUserDataAppPath();
|
const QString app_path = qApp->userDataAppFolder();
|
||||||
const QString home_path = qApp->getUserDataHomePath();
|
const QString home_path = qApp->userDataHomeFolder();
|
||||||
// We will use PORTABLE settings only and only if it is available and NON-PORTABLE
|
// We will use PORTABLE settings only and only if it is available and NON-PORTABLE
|
||||||
// settings was not initialized before.
|
// settings was not initialized before.
|
||||||
#if defined (Q_OS_LINUX) || defined (Q_OS_MACOS)
|
#if defined (Q_OS_LINUX) || defined (Q_OS_MACOS)
|
||||||
|
|
|
@ -71,7 +71,7 @@ void SkinFactory::setCurrentSkinName(const QString& skin_name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SkinFactory::customSkinBaseFolder() const {
|
QString SkinFactory::customSkinBaseFolder() const {
|
||||||
return qApp->userDataPath() + QDir::separator() + APP_SKIN_USER_FOLDER;
|
return qApp->userDataFolder() + QDir::separator() + APP_SKIN_USER_FOLDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SkinFactory::selectedSkinName() const {
|
QString SkinFactory::selectedSkinName() const {
|
||||||
|
|
|
@ -216,7 +216,7 @@ AdBlockCustomList* AdBlockManager::customList() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AdBlockManager::storedListsPath() {
|
QString AdBlockManager::storedListsPath() {
|
||||||
return qApp->userDataPath() + QDir::separator() + ADBLOCK_LISTS_SUBDIRECTORY;
|
return qApp->userDataFolder() + QDir::separator() + ADBLOCK_LISTS_SUBDIRECTORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdBlockManager::load() {
|
void AdBlockManager::load() {
|
||||||
|
|
|
@ -79,7 +79,7 @@ void CacheForServiceRoot::saveCacheToFile(int accId) {
|
||||||
m_cacheSaveMutex->lock();
|
m_cacheSaveMutex->lock();
|
||||||
|
|
||||||
// Save to file.
|
// Save to file.
|
||||||
const QString file_cache = qApp->userDataPath() + QDir::separator() + QString::number(accId) + "-cached-msgs.dat";
|
const QString file_cache = qApp->userDataFolder() + QDir::separator() + QString::number(accId) + "-cached-msgs.dat";
|
||||||
|
|
||||||
if (isEmpty()) {
|
if (isEmpty()) {
|
||||||
QFile::remove(file_cache);
|
QFile::remove(file_cache);
|
||||||
|
@ -110,7 +110,7 @@ void CacheForServiceRoot::loadCacheFromFile(int accId) {
|
||||||
clearCache();
|
clearCache();
|
||||||
|
|
||||||
// Load from file.
|
// Load from file.
|
||||||
const QString file_cache = qApp->userDataPath() + QDir::separator() + QString::number(accId) + "-cached-msgs.dat";
|
const QString file_cache = qApp->userDataFolder() + QDir::separator() + QString::number(accId) + "-cached-msgs.dat";
|
||||||
|
|
||||||
QFile file(file_cache);
|
QFile file(file_cache);
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ void FormFeedDetails::onNoIconSelected() {
|
||||||
|
|
||||||
void FormFeedDetails::onLoadIconFromFile() {
|
void FormFeedDetails::onLoadIconFromFile() {
|
||||||
QFileDialog dialog(this, tr("Select icon file for the feed"),
|
QFileDialog dialog(this, tr("Select icon file for the feed"),
|
||||||
qApp->getHomeFolderPath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
|
qApp->homeFolder(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
|
||||||
dialog.setFileMode(QFileDialog::ExistingFile);
|
dialog.setFileMode(QFileDialog::ExistingFile);
|
||||||
dialog.setWindowIcon(qApp->icons()->fromTheme(QSL("image-x-generic")));
|
dialog.setWindowIcon(qApp->icons()->fromTheme(QSL("image-x-generic")));
|
||||||
dialog.setOptions(QFileDialog::DontUseNativeDialog | QFileDialog::ReadOnly);
|
dialog.setOptions(QFileDialog::DontUseNativeDialog | QFileDialog::ReadOnly);
|
||||||
|
|
|
@ -172,7 +172,7 @@ void FormStandardCategoryDetails::onNoIconSelected() {
|
||||||
|
|
||||||
void FormStandardCategoryDetails::onLoadIconFromFile() {
|
void FormStandardCategoryDetails::onLoadIconFromFile() {
|
||||||
QFileDialog dialog(this, tr("Select icon file for the category"),
|
QFileDialog dialog(this, tr("Select icon file for the category"),
|
||||||
qApp->getHomeFolderPath(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
|
qApp->homeFolder(), tr("Images (*.bmp *.jpg *.jpeg *.png *.svg *.tga)"));
|
||||||
dialog.setFileMode(QFileDialog::ExistingFile);
|
dialog.setFileMode(QFileDialog::ExistingFile);
|
||||||
dialog.setWindowIcon(qApp->icons()->fromTheme(QSL("image-x-generic")));
|
dialog.setWindowIcon(qApp->icons()->fromTheme(QSL("image-x-generic")));
|
||||||
dialog.setOptions(QFileDialog::DontUseNativeDialog | QFileDialog::ReadOnly);
|
dialog.setOptions(QFileDialog::DontUseNativeDialog | QFileDialog::ReadOnly);
|
||||||
|
|
|
@ -153,7 +153,7 @@ void FormStandardImportExport::selectExportFile() {
|
||||||
filter += ";;";
|
filter += ";;";
|
||||||
filter += filter_txt_url_per_line;
|
filter += filter_txt_url_per_line;
|
||||||
QString selected_file = QFileDialog::getSaveFileName(this, tr("Select file for feeds export"),
|
QString selected_file = QFileDialog::getSaveFileName(this, tr("Select file for feeds export"),
|
||||||
qApp->getHomeFolderPath(), filter, &selected_filter);
|
qApp->homeFolder(), filter, &selected_filter);
|
||||||
|
|
||||||
if (!selected_file.isEmpty()) {
|
if (!selected_file.isEmpty()) {
|
||||||
if (selected_filter == filter_opml20) {
|
if (selected_filter == filter_opml20) {
|
||||||
|
@ -186,7 +186,7 @@ void FormStandardImportExport::selectImportFile() {
|
||||||
filter += filter_opml20;
|
filter += filter_opml20;
|
||||||
filter += ";;";
|
filter += ";;";
|
||||||
filter += filter_txt_url_per_line;
|
filter += filter_txt_url_per_line;
|
||||||
const QString selected_file = QFileDialog::getOpenFileName(this, tr("Select file for feeds import"), qApp->getHomeFolderPath(),
|
const QString selected_file = QFileDialog::getOpenFileName(this, tr("Select file for feeds import"), qApp->homeFolder(),
|
||||||
filter, &selected_filter);
|
filter, &selected_filter);
|
||||||
|
|
||||||
if (!selected_file.isEmpty()) {
|
if (!selected_file.isEmpty()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue