[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Jul 15 23:23:02 UTC 2005


SVN commit 435055 by okellogg:

UMLDrag::canDecode(): Move to UMLApp.

 M  +0 -12     clipboard/umldrag.cpp  
 M  +0 -5      clipboard/umldrag.h  
 M  +13 -24    uml.cpp  
 M  +5 -2      uml.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/clipboard/umldrag.cpp #435054:435055
@@ -296,18 +296,6 @@
     setEncodedData(domDoc.toString().utf8(), 0);
 }
 
-bool UMLDrag::canDecode(const QMimeSource* mimeSource) {
-    const char* f;
-    for (int i=0; (f=mimeSource->format(i)); i++) {
-        if ( 0==qstrnicmp(f,"application/x-uml-clip", 22) ) {
-            //FIXME need to test for clip1, clip2, clip3, clip4 or clip5
-            //(the only valid clip types)
-            return true;
-        }
-    }
-    return false;
-}
-
 bool UMLDrag::decodeClip1(const QMimeSource* mimeSource, UMLObjectList& objects,
                           UMLListViewItemList& umlListViewItems) {
     UMLDoc* doc = UMLApp::app()->getDocument();
--- trunk/KDE/kdesdk/umbrello/umbrello/clipboard/umldrag.h #435054:435055
@@ -134,11 +134,6 @@
     void setUMLDataClip5(UMLObjectList& Objects, UMLListViewItemList& UMLListViewItems);
 
     /**
-     *  Returns whether it can decode the given mimesource
-     */
-    static bool canDecode(const QMimeSource* mimeSource);
-
-    /**
      * Sets the type of the clip to "application/x-uml-" + sub
      *	sub should be clip[1-5]
      */
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #435054:435055
@@ -61,7 +61,6 @@
 #include "worktoolbar.h"
 
 #include "clipboard/umlclipboard.h"
-#include "clipboard/umldrag.h"
 #include "dialogs/classwizard.h"
 #include "dialogs/codegenerationwizard.h"
 #include "dialogs/codeviewerdialog.h"
@@ -141,7 +140,6 @@
     delete m_clipTimer;
     delete m_copyTimer;
 
-    delete statProg;
     delete m_statusLabel;
     delete m_refactoringAssist;
 }
@@ -360,17 +358,6 @@
 }
 
 void UMLApp::initStatusBar() {
-    /* Progress bar removed, it didn't reflect the actual load status of a file
-    statProg = new QProgressBar(statusBar(),"Progressbar");
-    statProg->setFixedWidth( 100 );             // arbitrary width
-    statProg->setCenterIndicator(true);
-    statProg->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
-    statProg->setMargin( 0 );
-    statProg->setLineWidth(0);
-    statProg->setBackgroundMode( QWidget::PaletteBackground );
-    statProg->setFixedHeight( statProg->sizeHint().height() - 8 );
-    */
-
     m_statusLabel = new KStatusBarLabel( i18n("Ready."), 0, statusBar() );
     m_statusLabel->setFixedHeight( m_statusLabel->sizeHint().height() );
 
@@ -380,18 +367,8 @@
 
     statusBar()->addWidget( m_statusLabel, 1, false );
 
-    /*
-    statusBar()->addWidget(statProg, 0,  true);
-    */
-
     m_statusLabel->setAlignment(AlignLeft|AlignVCenter);
 
-    /*
-    connect(m_doc,SIGNAL(sigSetStatusbarProgressSteps(int)),statProg,SLOT(setTotalSteps(int)));
-    connect(m_doc,SIGNAL(sigSetStatusbarProgress(int)),statProg,SLOT(setProgress(int)));
-    connect(m_doc,SIGNAL(sigResetStatusbarProgress()),statProg,SLOT(reset()));
-    */
-
     connect(m_doc, SIGNAL( sigWriteToStatusBar(const QString &) ), this, SLOT( slotStatusMsg(const QString &) ));
 }
 
@@ -1005,11 +982,23 @@
     connect(m_copyTimer, SIGNAL(timeout()), this, SLOT(slotCopyChanged()));
 }
 
+bool UMLApp::canDecode(const QMimeSource* mimeSource) {
+    const char* f;
+    for (int i=0; (f=mimeSource->format(i)); i++) {
+        if ( !qstrnicmp(f,"application/x-uml-clip", 22) ) {
+            //FIXME need to test for clip1, clip2, clip3, clip4 or clip5
+            //(the only valid clip types)
+            return true;
+        }
+    }
+    return false;
+}
+
 void UMLApp::slotClipDataChanged() {
     QMimeSource * data = QApplication::clipboard()->data();
 
     //Pass the MimeSource to the Doc
-    editPaste->setEnabled( data && UMLDrag::canDecode(data) );
+    editPaste->setEnabled( data && canDecode(data) );
 }
 
 void UMLApp::slotCopyChanged() {
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.h #435054:435055
@@ -24,7 +24,6 @@
 
 #include <qmap.h>
 #include <qdict.h>
-#include <qprogressbar.h>
 
 #include <kdockwidget.h>
 #include <kdeversion.h>
@@ -767,6 +766,11 @@
     ClassImport * m_classImporter;
 
     /**
+     *  Returns whether we can decode the given mimesource
+     */
+    static bool canDecode(const QMimeSource* mimeSource);
+
+    /**
      * Reads from the config file the options state.
      * Not in @ref readOptions as it needs to be read earlier than some
      * of the other options, before some items are created.
@@ -897,7 +901,6 @@
 
     KStatusBarLabel* m_statusLabel;
 
-    QGuardedPtr<QProgressBar> statProg;
     /**
      * True if the application is opening an existing document
      */




More information about the umbrello-devel mailing list