author | llornkcor <llornkcor> | 2002-07-10 15:20:43 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-10 15:20:43 (UTC) |
commit | e17d551a7c42a1d77805b4f1575928855e0e32ba (patch) (side-by-side diff) | |
tree | 58fe47dc0cefc26f17680a8410ec906a5f300f47 | |
parent | 7f3bc923c0ae1ecfc40215e461d31ad513ec6a94 (diff) | |
download | opie-e17d551a7c42a1d77805b4f1575928855e0e32ba.zip opie-e17d551a7c42a1d77805b4f1575928855e0e32ba.tar.gz opie-e17d551a7c42a1d77805b4f1575928855e0e32ba.tar.bz2 |
fixed crash with delete check entry
-rw-r--r-- | noncore/apps/checkbook/qcheckbook.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/checkbook/qcheckview.cpp | 0 |
2 files changed, 1 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/qcheckbook.cpp b/noncore/apps/checkbook/qcheckbook.cpp index 797127e..bb7a5ac 100644 --- a/noncore/apps/checkbook/qcheckbook.cpp +++ b/noncore/apps/checkbook/qcheckbook.cpp @@ -1,130 +1,128 @@ #include "qcheckbook.h" #include <qmenubar.h> #include <qstatusbar.h> #include <qpopupmenu.h> #include <qapplication.h> #include <qfile.h> #include <qdir.h> QCheckBook::QCheckBook() : QMainWindow(), m_view(), m_view2(), m_view3() { initCheck = false; initMM = false; setCaption("Checking"); statusBar()->hide(); menuBar()->hide(); bar = new QToolBar(this); bar->setHorizontalStretchable( TRUE ); addToolBar(bar); Config config("qcheckbook"); config.setGroup("Global"); QString lastCheck = config.readEntry("LastCheckBook", QString("")); QString checkdirname = QDir::homeDirPath(); checkdirname.append("/.checkbooks/"); checkdirname.append(lastCheck); QFile f(checkdirname); if (lastCheck.isEmpty() == false && lastCheck != "" && f.exists() == true) { newCheck(lastCheck); } else { initMainMenus(); } setToolBarsMovable( FALSE ); } void QCheckBook::newCheck(const QString &filename) { if (filename.isEmpty() == false) { initCheck = true; if (m_view != 0) { + m_view=0; delete m_view; } m_view = new QCheckView(this, filename); m_view->hide(); connect(m_view, SIGNAL(reload(const QString &)), this, SLOT(newCheck(const QString &))); - if (initMM == true) { delete nb1; } - bar->clear(); - mbar = new QMenuBar(bar); mbar->setMargin(0); QPixmap newIcon = Resource::loadPixmap( "new" ); nb2 = new QToolButton( newIcon, "New", QString::null, m_view, SLOT(newClicked()), bar, "new item" ); QPixmap pixmap = Resource::loadPixmap( "pixmap" ); m_filename = filename; nb3 = new QToolButton( pixmap, "Graph", QString::null, this, SLOT(newGraph()), bar, "new graph" ); QPixmap closeIcon = Resource::loadPixmap( "close" ); nb4 = new QToolButton( closeIcon, "Close", QString::null, this, SLOT(initMainMenus()), bar, "close graph" ); popup = new QPopupMenu(m_view); popup->insertItem("&New Entry", m_view, SLOT(newClicked())); popup->insertItem("&Graph Checkbook", this, SLOT(newGraph())); popup->insertItem("&Close Checkbook", this, SLOT(initMainMenus())); popup->insertItem("&Exit", this, SLOT(close())); mbar->insertItem("&File", popup); setCentralWidget(m_view); m_view->show(); Config config("qcheckbook"); config.setGroup("Global"); config.writeEntry("LastCheckBook", filename); initMM = false; } } void QCheckBook::close() { QApplication::exit(); } void QCheckBook::newGraph() { if (m_filename.isEmpty() == false) { m_view2 = new QCheckGraph(m_filename); m_view2->showMaximized(); } } void QCheckBook::initMainMenus() { Config config("qcheckbook"); config.setGroup("Global"); config.writeEntry("LastCheckBook", QString("")); initMM = true; m_filename = ""; if (m_view3 != 0) { delete m_view3; } m_view3 = new QCheckMainMenu(this); m_view3->hide(); if (initCheck == true) { delete nb2; delete nb3; delete nb4; } diff --git a/noncore/apps/checkbook/qcheckview.cpp b/noncore/apps/checkbook/qcheckview.cpp index 6f103e2..ddc3fa9 100644 --- a/noncore/apps/checkbook/qcheckview.cpp +++ b/noncore/apps/checkbook/qcheckview.cpp |