From 682062b5e389c5e3ebd8cac4705a3e5ba1ac1843 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Sun, 4 Oct 2020 07:29:47 +0300 Subject: [PATCH] - more work on refactoring --- client/CMakeLists.txt | 10 ++++---- client/build-number/build_number.h | 2 +- client/mainwindow.cpp | 38 ++++++++++++++---------------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index ef1a1f4..7903eff 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -6,8 +6,8 @@ set (CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment v project (outliner C CXX) # Your project name if (NOT LIB_PLATFORM) - message("No LIB_PLATFORM is set, defaulting to works/sevana/platform/libraries") - set (LIB_PLATFORM ${CMAKE_CURRENT_SOURCE_DIR}/../../../sevana/platform/libraries) + message("No LIB_PLATFORM is set, defaulting to works/sevana/libraries") + set (LIB_PLATFORM ${CMAKE_CURRENT_SOURCE_DIR}/../../../sevana/libraries) endif() include (${LIB_PLATFORM}/platform_libs.cmake) @@ -61,7 +61,7 @@ set (SOURCES finddialog.cpp findsupport.cpp helper.cpp - initial_ui.cpp + # initial_ui.cpp logger.cpp main.cpp mainwindow.cpp @@ -102,7 +102,7 @@ set (HEADERS finddialog.h findsupport.h helper.h - initial_ui.h + # initial_ui.h logger.h mainwindow.h #moc_predefs.h @@ -166,7 +166,7 @@ if (TARGET_LINUX) endif() if(TARGET_OSX) - message("MacOS build target") + message ("MacOS build target") # OS X Specific flags add_definitions(-DTARGET_OSX) diff --git a/client/build-number/build_number.h b/client/build-number/build_number.h index b6656d7..27d82e9 100644 --- a/client/build-number/build_number.h +++ b/client/build-number/build_number.h @@ -1,2 +1,2 @@ // Auto generated file ! Please do not edit ! -#define APP_BUILD_NUMBER 74 \ No newline at end of file +#define APP_BUILD_NUMBER 88 \ No newline at end of file diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index d3ad1ba..11e7932 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -64,12 +64,28 @@ MainWindow::MainWindow(QWidget *parent) : loadGeometry(); + this->setUpdatesEnabled(true); +} + +MainWindow::~MainWindow() +{ + delete ui; + //delete mCurrentIntervalLabel; +} + + +void MainWindow::attachDatabase() +{ // Find default database file exists QString path = helper::path::pathToDatabase(); // Find optional custom path to database if (mSettings->data()[KEY_DB_FILENAME_SPECIFIED].toBool()) + { path = mSettings->data()[KEY_DB_FILENAME].toString(); + if (path.contains("~")) + path.replace("~", QDir::homePath()); + } QString folder = QFileInfo(path).absoluteDir().path(); Storage::instance().setPath(path); @@ -97,26 +113,6 @@ MainWindow::MainWindow(QWidget *parent) : else askDbPassword(QString()); } - this->setUpdatesEnabled(true); -} - -MainWindow::~MainWindow() -{ - delete ui; - //delete mCurrentIntervalLabel; -} - - -void MainWindow::attachDatabase() -{ - // Open database - QString path = helper::path::pathToDatabase(); - - if (mSettings->data()[KEY_DB_FILENAME_SPECIFIED].toBool()) - path = mSettings->data()[KEY_DB_FILENAME].toString(); - - QString folder = QFileInfo(path).absoluteDir().path(); - Storage::instance().setPath(path); this->setUpdatesEnabled(true); } @@ -261,6 +257,8 @@ void MainWindow::initClient() #endif mTimeFrameHeight = 64;//ui->mTimeFrame->height(); ui->mStartRecentTaskMenu->setEnabled(false); + + buildOpenOrCreateView(); } void MainWindow::save()