|
|
@ -73,7 +73,7 @@ int main(int argc, char **argv) |
|
|
|
AppDir = QApplication::applicationFilePath(); |
|
|
|
AppDir = QApplication::applicationFilePath(); |
|
|
|
AppDir.truncate(AppDir.lastIndexOf("/")); |
|
|
|
AppDir.truncate(AppDir.lastIndexOf("/")); |
|
|
|
#if defined(Q_OS_LINUX) |
|
|
|
#if defined(Q_OS_LINUX) |
|
|
|
DataDir = AppDir+"/../share/keepassx"; |
|
|
|
DataDir = AppDir+"/../share/keepassx1"; |
|
|
|
if (!QFile::exists(DataDir) && QFile::exists(AppDir+"/share")) |
|
|
|
if (!QFile::exists(DataDir) && QFile::exists(AppDir+"/share")) |
|
|
|
DataDir = AppDir+"/share"; |
|
|
|
DataDir = AppDir+"/share"; |
|
|
|
const char* env = getenv("XDG_CONFIG_HOME"); |
|
|
|
const char* env = getenv("XDG_CONFIG_HOME"); |
|
|
@ -89,14 +89,14 @@ int main(int argc, char **argv) |
|
|
|
} |
|
|
|
} |
|
|
|
HomeDir += "/keepassx"; |
|
|
|
HomeDir += "/keepassx"; |
|
|
|
#elif defined(Q_OS_MAC) |
|
|
|
#elif defined(Q_OS_MAC) |
|
|
|
HomeDir = QDir::homePath()+"/.keepassx"; |
|
|
|
HomeDir = QDir::homePath()+"/.keepassx1"; |
|
|
|
DataDir = AppDir+"/../Resources/keepassx"; |
|
|
|
DataDir = AppDir+"/../Resources/keepassx1"; |
|
|
|
#elif defined(Q_OS_WIN32) |
|
|
|
#elif defined(Q_OS_WIN32) |
|
|
|
HomeDir = qtWindowsConfigPath(0); |
|
|
|
HomeDir = qtWindowsConfigPath(0); |
|
|
|
if(!HomeDir.isEmpty() && QFile::exists(HomeDir)) |
|
|
|
if(!HomeDir.isEmpty() && QFile::exists(HomeDir)) |
|
|
|
HomeDir = QDir::fromNativeSeparators(HomeDir)+"/KeePassX"; |
|
|
|
HomeDir = QDir::fromNativeSeparators(HomeDir)+"/KeePassX1"; |
|
|
|
else |
|
|
|
else |
|
|
|
HomeDir = QDir::homePath()+"/KeePassX"; |
|
|
|
HomeDir = QDir::homePath()+"/KeePassX1"; |
|
|
|
|
|
|
|
|
|
|
|
DataDir = AppDir+"/share"; |
|
|
|
DataDir = AppDir+"/share"; |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -128,7 +128,7 @@ int main(int argc, char **argv) |
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_LINUX |
|
|
|
#ifdef Q_OS_LINUX |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString OldHomeDir = QDir::homePath()+"/.keepassx"; |
|
|
|
QString OldHomeDir = QDir::homePath()+"/.keepassx1"; |
|
|
|
if (args.configLocation().isEmpty() && QFile::exists(OldHomeDir+"/config") && !QFile::exists(HomeDir+"/config")) { |
|
|
|
if (args.configLocation().isEmpty() && QFile::exists(OldHomeDir+"/config") && !QFile::exists(HomeDir+"/config")) { |
|
|
|
QFile::rename(OldHomeDir+"/config", HomeDir+"/config.ini"); |
|
|
|
QFile::rename(OldHomeDir+"/config", HomeDir+"/config.ini"); |
|
|
|
if (QDir(OldHomeDir).entryList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System).count()==0) |
|
|
|
if (QDir(OldHomeDir).entryList(QDir::AllEntries|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System).count()==0) |
|
|
|