Skip to content

Commit

Permalink
Merge pull request #1252 from kiwix/fix_for_issue_1235
Browse files Browse the repository at this point in the history
Fixed the crash on application launch under Windows
  • Loading branch information
kelson42 authored Nov 22, 2024
2 parents 63b421e + e6a8622 commit 955c1d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/kiwixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ KiwixApp::KiwixApp(int& argc, char *argv[])
m_server(m_library.getKiwixLibrary(), mp_nameMapper),
mp_session(nullptr)
{
/* Place session file in our global library path */
QDir dir(m_libraryDirectory);
mp_session = new QSettings(dir.filePath("kiwix-desktop.session"),
QSettings::defaultFormat(), this);
try {
m_translation.setTranslation(QLocale());
} catch (std::exception& e) {
Expand Down Expand Up @@ -172,10 +176,6 @@ QString KiwixApp::findLibraryDirectory()

void KiwixApp::restoreTabs()
{
/* Place session file in our global library path */
QDir dir(m_libraryDirectory);
mp_session = new QSettings(dir.filePath("kiwix-desktop.session"),
QSettings::defaultFormat(), this);
QStringList tabsToOpen = mp_session->value("reopenTabList").toStringList();

/* Restart a new session to prevent duplicate records in openURL */
Expand Down
2 changes: 1 addition & 1 deletion src/suggestionlistdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ QString getElidedText(const QFont& font, int length, const QString& text)
const int textLength = length - elideMarkerLength;
QString elidedText = metrics.elidedText(text, Qt::ElideRight, textLength);
if (elidedText != text)
return elidedText.chopped(1);
return elidedText.isEmpty() ? "" : elidedText.chopped(1);
return text;
}

Expand Down

0 comments on commit 955c1d5

Please sign in to comment.