Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/KisApplication.cpp
Context not available. | |||||
889 | KIS_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread()); | 889 | KIS_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread()); | ||
---|---|---|---|---|---|
890 | 890 | | |||
891 | KSharedConfigPtr config = KSharedConfig::openConfig(); | 891 | KSharedConfigPtr config = KSharedConfig::openConfig(); | ||
892 | | ||||
893 | // find user settings file | 892 | // find user settings file | ||
894 | bool createDir = false; | 893 | QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); | ||
895 | QString kritarcPath = KoResourcePaths::locateLocal("config", "kritarc", createDir); | 894 | QString kritarcPath = configPath + QStringLiteral("/kritarc"); | ||
896 | 895 | | |||
897 | QFile configFile(kritarcPath); | 896 | QFile configFile(kritarcPath); | ||
898 | if (configFile.exists()) { | 897 | if (configFile.exists()) { | ||
Context not available. | |||||
902 | } | 901 | } | ||
903 | else { | 902 | else { | ||
904 | QMessageBox::warning(0, | 903 | QMessageBox::warning(0, | ||
905 | i18nc("@title:window", "Krita"), | 904 | i18nc("@title:window", "Krita"), | ||
906 | i18n("Failed to clear %1\n\n" | 905 | i18n("Failed to clear %1\n\n" | ||
907 | "Please make sure no other program is using the file and try again.", | 906 | "Please make sure no other program is using the file and try again.", | ||
908 | kritarcPath), | 907 | kritarcPath), | ||
909 | QMessageBox::Ok, QMessageBox::Ok); | 908 | QMessageBox::Ok, QMessageBox::Ok); | ||
910 | } | 909 | } | ||
911 | } | 910 | } | ||
912 | 911 | | |||
Context not available. | |||||
918 | 917 | | |||
919 | void KisApplication::askClearConfig() | 918 | void KisApplication::askClearConfig() | ||
920 | { | 919 | { | ||
921 | Qt::KeyboardModifiers mods = QApplication::queryKeyboardModifiers(); | 920 | bool ok = QMessageBox::question(0, | ||
922 | bool askClearConfig = (mods & Qt::ControlModifier) && (mods & Qt::ShiftModifier) && (mods & Qt::AltModifier); | 921 | i18nc("@title:window", "Krita"), | ||
923 | 922 | i18n("Do you want to clear the settings file?"), | |||
924 | if (askClearConfig) { | 923 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes; | ||
925 | bool ok = QMessageBox::question(0, | 924 | if (ok) { | ||
926 | i18nc("@title:window", "Krita"), | 925 | clearConfig(); | ||
927 | i18n("Do you want to clear the settings file?"), | | |||
928 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes; | | |||
929 | if (ok) { | | |||
930 | clearConfig(); | | |||
931 | } | | |||
932 | } | 926 | } | ||
933 | } | 927 | } | ||
Context not available. |