From 7e04934c4b7b9f8ad0d74d2da1c7c1273d9fe1d4 Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 14 Mar 2003 08:20:59 +0000 Subject: Do not crash when trying to edit and there is no data --- (limited to 'core') diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 7810285..58981ca 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -630,6 +630,7 @@ void MainWindow::slotShow( int uid ) { m_stack->raiseWidget( currentShow()->widget() ); } void MainWindow::slotEdit( int uid ) { + if (uid == 1 ) return; if(m_syncing) { QMessageBox::warning(this, QWidget::tr("Todo"), QWidget::tr("Can not edit data, currently syncing")); @@ -791,7 +792,7 @@ void MainWindow::beam( int uid) { Ir* ir = new Ir(this ); connect(ir, SIGNAL(done(Ir*) ), this, SLOT(beamDone(Ir*) ) ); - ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); + ir->send(beamfile, todo.summary(), "text/x-vCalendar" ); } void MainWindow::show( int uid ) { slotShow( uid ); diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index ae27fab..d9cda09 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp @@ -143,6 +143,7 @@ QString TableView::type() const { return QString::fromLatin1( tr("Table View") ); } int TableView::current() { + if (numRows() == 0 ) return 1; int uid = sorted().uidAt(currentRow() ); return uid; -- cgit v0.9.0.2