Fix comment display and more renaming to keepassx1

qt5
Thomas Hooge 3 years ago
parent e9f333c5c1
commit c115c7cd7f
  1. 32
      src/CMakeLists.txt
  2. 4
      src/keepassx1.h
  3. 12
      src/main.cpp
  4. 3
      src/mainwindow.cpp

@ -122,22 +122,22 @@ SET(keepassx_FORMS
SET(keepassx_RESOURCES res/resources.qrc) SET(keepassx_RESOURCES res/resources.qrc)
set(keepassx_TRANSLATIONS set(keepassx_TRANSLATIONS
# translations/keepassx-cs_CZ.ts # translations/keepassx1-cs_CZ.ts
translations/keepassx-de_DE.ts translations/keepassx1-de_DE.ts
translations/keepassx-es_ES.ts translations/keepassx1-es_ES.ts
translations/keepassx-fi_FI.ts translations/keepassx1-fi_FI.ts
translations/keepassx-fr_FR.ts translations/keepassx1-fr_FR.ts
translations/keepassx-gl_ES.ts translations/keepassx1-gl_ES.ts
translations/keepassx-hu_HU.ts translations/keepassx1-hu_HU.ts
translations/keepassx-it_IT.ts translations/keepassx1-it_IT.ts
translations/keepassx-ja_JP.ts translations/keepassx1-ja_JP.ts
translations/keepassx-nb_NO.ts translations/keepassx1-nb_NO.ts
translations/keepassx-nl_NL.ts translations/keepassx1-nl_NL.ts
translations/keepassx-pl_PL.ts translations/keepassx1-pl_PL.ts
translations/keepassx-ru_RU.ts translations/keepassx1-ru_RU.ts
translations/keepassx-tr_TR.ts translations/keepassx1-tr_TR.ts
translations/keepassx-uk_UA.ts translations/keepassx1-uk_UA.ts
translations/keepassx-zh_CN.ts translations/keepassx1-zh_CN.ts
translations/qt_fi.ts translations/qt_fi.ts
translations/qt_hu.ts translations/qt_hu.ts
translations/qt_it.ts translations/qt_it.ts

@ -22,8 +22,8 @@
// global defines // global defines
#define APP_DISPLAY_NAME "KeePassX" #define APP_DISPLAY_NAME "KeePassX1"
#define APP_CODE_NAME "keepassx" #define APP_CODE_NAME "keepassx1"
#define APP_SHORT_FUNC "Password Manager" #define APP_SHORT_FUNC "Password Manager"
#define APP_LONG_FUNC "Cross Platform Password Manager" #define APP_LONG_FUNC "Cross Platform Password Manager"
#define APP_VERSION "0.4.4" #define APP_VERSION "0.4.4"

@ -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)

@ -761,7 +761,8 @@ void KeepassMainWindow::updateDetailView(){
templ.replace("%lastmod%", QString(entry->lastMod().toString(Qt::SystemLocaleDate)).toHtmlEscaped()); templ.replace("%lastmod%", QString(entry->lastMod().toString(Qt::SystemLocaleDate)).toHtmlEscaped());
templ.replace("%lastaccess%", QString(entry->lastAccess().toString(Qt::SystemLocaleDate)).toHtmlEscaped()); templ.replace("%lastaccess%", QString(entry->lastAccess().toString(Qt::SystemLocaleDate)).toHtmlEscaped());
templ.replace("%expire%", QString(entry->expire().toString(Qt::SystemLocaleDate)).toHtmlEscaped()); templ.replace("%expire%", QString(entry->expire().toString(Qt::SystemLocaleDate)).toHtmlEscaped());
templ.replace("%comment%", QString(entry->comment().replace("\n","<br/>")).toHtmlEscaped()); QStringList commentlines = entry->comment().toHtmlEscaped().split("\n");
templ.replace("%comment%", commentlines.join("<br>"));
templ.replace("%attachment%", QString(entry->binaryDesc()).toHtmlEscaped()); templ.replace("%attachment%", QString(entry->binaryDesc()).toHtmlEscaped());
if(entry->expire()!=Date_Never){ if(entry->expire()!=Date_Never){