Bug 136288

Summary: Shift + Left and Shift+Right causes SIGSEGV
Product: [Applications] umbrello Reporter: Maruschenko Dmitry <maruschenko>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash CC: sasq
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Maruschenko Dmitry 2006-10-25 13:21:49 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages

Behaviour:
----------

Umbrello crashes with SIGSEGV when I press Shift+Left (or Shift+Right).

Crash Log:
----------

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
...
<SKIPPED>
...
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1234221392 (LWP 6244)]
(no debugging symbols found)
(no debugging symbols found)
...
<SKIPPED>
...
(no debugging symbols found)
(no debugging symbols found)
[KCrash handler]
#6  0xb78f87fd in QTabWidget::currentPageIndex () from /usr/lib/libqt-mt.so.3
#7  0x0810c9c8 in UMLApp::slotChangeTabRight ()
#8  0x081d0abf in UMLApp::qt_invoke ()
#9  0xb77a7957 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#10 0xb77a83fc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#11 0xb68cb3b9 in KAction::activated () from /usr/lib/libkdeui.so.4
#12 0xb6908c02 in KAction::slotActivated () from /usr/lib/libkdeui.so.4
#13 0xb69d154f in KAction::qt_invoke () from /usr/lib/libkdeui.so.4
#14 0xb77a7957 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#15 0xb77a83fc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#16 0xb7e0a249 in KAccelPrivate::menuItemActivated ()
   from /usr/lib/libkdecore.so.4
#17 0xb7e593d7 in KAccelPrivate::emitActivatedSignal ()
   from /usr/lib/libkdecore.so.4
#18 0xb7ef746e in KAccelPrivate::eventFilter () from /usr/lib/libkdecore.so.4
#19 0xb77a6f04 in QObject::activate_filters () from /usr/lib/libqt-mt.so.3
#20 0xb77a6f82 in QObject::event () from /usr/lib/libqt-mt.so.3
#21 0xb77de65b in QWidget::event () from /usr/lib/libqt-mt.so.3
#22 0xb78b4c5e in QMainWindow::event () from /usr/lib/libqt-mt.so.3
#23 0xb773eb88 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#24 0xb7740b58 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#25 0xb7eefdb2 in KApplication::notify () from /usr/lib/libkdecore.so.4
#26 0xb76d13fd in QApplication::sendSpontaneousEvent ()
   from /usr/lib/libqt-mt.so.3
#27 0xb773b93f in QAccelManager::tryAccelEvent () from /usr/lib/libqt-mt.so.3
#28 0xb773c1ff in qt_tryAccelEvent () from /usr/lib/libqt-mt.so.3
#29 0xb76c15b0 in QETWidget::translateKeyEvent () from /usr/lib/libqt-mt.so.3
#30 0xb76ce1cf in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#31 0xb76e5320 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#32 0xb775925e in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#33 0xb775906e in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#34 0xb7740731 in QApplication::exec () from /usr/lib/libqt-mt.so.3
#35 0x081d00f7 in main ()

How to reproduce:
-----------------
Open Umbrello, then open any XMI document with diagrams. Press Shift-Left.

My operating system:
--------------------
Kubuntu Edge Eft, KDE 3.5.5 from ubuntu repo, umbrello 1.5.5 from ubuntu repo.
Comment 1 Oliver Kellogg 2006-10-26 21:01:13 UTC
SVN commit 599343 by okellogg:

slotChangeTab{Left,Right}: Cycle through the available diagrams when tabbed
 diagrams are turned off.
Stop supporting KDE 3.1 while we're at it.
BUG:136288


 M  +6 -0      ChangeLog  
 M  +1 -1      VERSION  
 M  +31 -29    umbrello/uml.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #599342:599343
@@ -1,4 +1,10 @@
+Version 1.5.52
+
+* Bugs/wishes from http://bugs.kde.org:
+* Shift + Left and Shift+Right causes SIGSEGV (136288)
+
 Version 1.5.51
+
 * This is an interim release that fixes a serious regression in version 1.5.5
   which is detailed at http://bugs.kde.org/135749 (Crash when opening a document)
 
--- branches/KDE/3.5/kdesdk/umbrello/VERSION #599342:599343
@@ -1 +1 @@
-1.5.51
+1.5.52
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/uml.cpp #599342:599343
@@ -36,9 +36,7 @@
 #include <kstandarddirs.h>
 #include <kstatusbar.h>
 #include <ktip.h>
-#if KDE_IS_VERSION(3,1,90)
 #include <ktabwidget.h>
-#endif
 #include <ktoolbarbutton.h>
 #include <kpopupmenu.h>
 
@@ -175,13 +173,8 @@
     editCut = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection());
     editCopy = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection());
     editPaste = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection());
-#if KDE_IS_VERSION(3,1,90)
     createStandardStatusBarAction();
     setStandardToolBarMenuEnabled(true);
-#else
-    viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
-    viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
-#endif
     selectAll = KStdAction::selectAll(this,  SLOT( slotSelectAll() ), actionCollection());
     fileExportDocbook = new KAction(i18n("&Export model to DocBook"), 0, 
                                     this, SLOT( slotFileExportDocbook() ), 
@@ -218,10 +211,6 @@
     editCut->setToolTip(i18n("Cuts the selected section and puts it to the clipboard"));
     editCopy->setToolTip(i18n("Copies the selected section to the clipboard"));
     editPaste->setToolTip(i18n("Pastes the contents of the clipboard"));
-#if !KDE_IS_VERSION(3,1,90)
-    viewToolBar->setToolTip(i18n("Enables/disables the toolbar"));
-    viewStatusBar->setToolTip(i18n("Enables/disables the statusbar"));
-#endif
     preferences->setToolTip( i18n( "Set the default program preferences") );
 
     deleteSelectedWidget = new KAction( i18n("Delete &Selected"),
@@ -410,7 +399,6 @@
     addToolBar(m_alignToolBar, Qt::DockTop, false);
 
     m_mainDock = createDockWidget("maindock", 0L, 0L, "main dock");
-#if KDE_IS_VERSION(3,1,90)
     m_newSessionButton = NULL;
     m_diagramMenu = NULL;
     m_closeDiagramButton = NULL;
@@ -457,7 +445,6 @@
         m_mainDock->setWidget(m_tabWidget);
     }
     else
-#endif
     {
         m_tabWidget = NULL;
         m_viewStack = new QWidgetStack(m_mainDock, "viewstack");
@@ -531,11 +518,7 @@
     if( m_doc->URL().fileName() == i18n( "Untitled" ) ) {
         m_config -> writeEntry( "lastFile", "" );
     } else {
-#if KDE_IS_VERSION(3,1,3)
         m_config -> writePathEntry( "lastFile", m_doc -> URL().prettyURL() );
-#else
-        m_config -> writeEntry( "lastFile", m_doc -> URL().prettyURL() );
-#endif
     }
     m_config->writeEntry( "imageMimeType", getImageMimeType() );
 
@@ -609,11 +592,7 @@
 
     } else {
         KURL url=m_doc->URL();
-#if KDE_IS_VERSION(3,1,3)
         _config->writePathEntry("filename", url.url());
-#else
-        _config->writeEntry("filename", url.url());
-#endif
         _config->writeEntry("modified", m_doc->isModified());
         QString tempname = kapp->tempSaveName(url.url());
         QString tempurl= KURL::encode_string(tempname);
@@ -1607,11 +1586,9 @@
 }
 
 QWidget* UMLApp::getMainViewWidget() {
-#if KDE_IS_VERSION(3,1,90)
     Settings::OptionState& optionState = Settings::getOptionState();
     if (optionState.generalState.tabdiagrams)
         return m_tabWidget;
-#endif
     return m_viewStack;
 }
 
@@ -1623,6 +1600,9 @@
     kapp->processEvents();
     if (view) {
         slotStatusMsg(view->getName());
+        UMLListViewItem* lvitem = m_listView->findView(view);
+        if (lvitem)
+            m_listView->setCurrentItem(lvitem);
     }
 }
 
@@ -1655,15 +1635,37 @@
 }
 
 void UMLApp::slotChangeTabLeft() {
-#if KDE_IS_VERSION(3,1,90)
-    m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() - 1 );
-#endif
+    if (m_tabWidget) {
+        m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() - 1 );
+        return;
+    }
+    UMLViewList views = m_doc->getViewIterator();
+    UMLView *currView = m_view;
+    if (views.find(currView) < 0) {
+        kdError() << "UMLApp::slotChangeTabLeft(): currView not found in viewlist" << endl;
+        return;
+    }
+    if ((currView = views.prev()) != NULL)
+        setCurrentView(currView);
+    else
+        setCurrentView(views.last());
 }
 
 void UMLApp::slotChangeTabRight() {
-#if KDE_IS_VERSION(3,1,90)
-    m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() + 1 );
-#endif
+    if (m_tabWidget) {
+        m_tabWidget->setCurrentPage( m_tabWidget->currentPageIndex() + 1 );
+        return;
+    }
+    UMLViewList views = m_doc->getViewIterator();
+    UMLView *currView = m_view;
+    if (views.find(currView) < 0) {
+        kdError() << "UMLApp::slotChangeTabRight(): currView not found in viewlist" << endl;
+        return;
+    }
+    if ((currView = views.next()) != NULL)
+        setCurrentView(currView);
+    else
+        setCurrentView(views.first());
 }
 
 void UMLApp::slotMoveTabLeft() {
Comment 2 Oliver Kellogg 2007-01-30 07:37:36 UTC
*** Bug 140872 has been marked as a duplicate of this bug. ***