- fix crash on exit without opened database
This commit is contained in:
parent
9f47e9cb37
commit
0d02f89a4b
@ -271,6 +271,8 @@ void MainWindow::initClient()
|
|||||||
void MainWindow::save()
|
void MainWindow::save()
|
||||||
{
|
{
|
||||||
// Flush current task
|
// Flush current task
|
||||||
|
if (mTaskTreeModel)
|
||||||
|
{
|
||||||
PTask t = mTaskTreeModel->getTask(ui->mTaskTree->currentIndex());
|
PTask t = mTaskTreeModel->getTask(ui->mTaskTree->currentIndex());
|
||||||
if (t)
|
if (t)
|
||||||
{
|
{
|
||||||
@ -278,6 +280,7 @@ void MainWindow::save()
|
|||||||
t->save();
|
t->save();
|
||||||
mModifiedLabel->setText(tr("Saved"));
|
mModifiedLabel->setText(tr("Saved"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -54,18 +54,18 @@ private:
|
|||||||
TrackingStopReason mStopReason;
|
TrackingStopReason mStopReason;
|
||||||
|
|
||||||
Ui::MainWindow *ui = nullptr;
|
Ui::MainWindow *ui = nullptr;
|
||||||
TaskTreeModel* mTaskTreeModel;
|
TaskTreeModel* mTaskTreeModel = nullptr;
|
||||||
PTask mCurrentTask, mAutomaticTask;
|
PTask mCurrentTask, mAutomaticTask;
|
||||||
QTimer* mUpdateTimer;
|
QTimer* mUpdateTimer = nullptr;
|
||||||
QLabel* mModifiedLabel;
|
QLabel* mModifiedLabel = nullptr;
|
||||||
QLabel* mCurrentIntervalLabel;
|
QLabel* mCurrentIntervalLabel = nullptr;
|
||||||
QLabel* mDuplicationSignalLabel;
|
QLabel* mDuplicationSignalLabel = nullptr;;
|
||||||
QSystemTrayIcon *mTrayIcon;
|
QSystemTrayIcon *mTrayIcon = nullptr;
|
||||||
QSharedPointer<Settings> mSettings;
|
QSharedPointer<Settings> mSettings;
|
||||||
bool mPasswordFailed;
|
bool mPasswordFailed;
|
||||||
PasswordDlg* mPasswordDlg;
|
PasswordDlg* mPasswordDlg = nullptr;
|
||||||
NewPasswordDlg* mNewPasswordDlg;
|
NewPasswordDlg* mNewPasswordDlg = nullptr;
|
||||||
QMessageBox* mAlertBox;
|
QMessageBox* mAlertBox = nullptr;
|
||||||
|
|
||||||
// Time when current note was saved to DB last time
|
// Time when current note was saved to DB last time
|
||||||
QDateTime mLastTimelineFlush;
|
QDateTime mLastTimelineFlush;
|
||||||
@ -74,7 +74,7 @@ private:
|
|||||||
QAction* mAttachmentsAction;
|
QAction* mAttachmentsAction;
|
||||||
|
|
||||||
// Attachments label
|
// Attachments label
|
||||||
QLabel* mAttachmentsLabel;
|
QLabel* mAttachmentsLabel = nullptr;
|
||||||
|
|
||||||
// Delegate to draw task items in custom way
|
// Delegate to draw task items in custom way
|
||||||
TaskItemDelegate mTaskItemDelegate;
|
TaskItemDelegate mTaskItemDelegate;
|
||||||
@ -92,7 +92,7 @@ private:
|
|||||||
|
|
||||||
QDateTime mTextModificationTime;
|
QDateTime mTextModificationTime;
|
||||||
std::deque<PTask> mRecentTrackingTasks;
|
std::deque<PTask> mRecentTrackingTasks;
|
||||||
QMenu* mDockRecentMenu;
|
QMenu* mDockRecentMenu = nullptr;
|
||||||
QDialog* mTrayWindow = nullptr;
|
QDialog* mTrayWindow = nullptr;
|
||||||
QString mPassword = NOPASSWORDSTRING;
|
QString mPassword = NOPASSWORDSTRING;
|
||||||
ConnectDbWidget* mConnectDbWidget = nullptr;
|
ConnectDbWidget* mConnectDbWidget = nullptr;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user