Hello community,

here is the log from the commit of package umbrello for openSUSE:Factory 
checked in at 2014-02-20 07:57:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/umbrello (Old)
 and      /work/SRC/openSUSE:Factory/.umbrello.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "umbrello"

Changes:
--------
--- /work/SRC/openSUSE:Factory/umbrello/umbrello.changes        2014-01-27 
11:19:05.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.umbrello.new/umbrello.changes   2014-02-20 
07:58:40.000000000 +0100
@@ -1,0 +2,7 @@
+Sat Feb  1 10:40:40 UTC 2014 - tittiatc...@gmail.com
+
+- Update to 4.12.2
+   * KDE 4.12.2  release
+   * See http://www.kde.org/announcements/announce-4.12.2.php
+
+-------------------------------------------------------------------

Old:
----
  umbrello-4.12.1.tar.xz

New:
----
  umbrello-4.12.2.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ umbrello.spec ++++++
--- /var/tmp/diff_new_pack.6BgUEW/_old  2014-02-20 07:58:40.000000000 +0100
+++ /var/tmp/diff_new_pack.6BgUEW/_new  2014-02-20 07:58:40.000000000 +0100
@@ -24,7 +24,7 @@
 License:        GPL-2.0 and GFDL-1.2
 Group:          Development/Tools/Other
 Url:            http://www.kde.org/
-Version:        4.12.1
+Version:        4.12.2
 Release:        0
 Source0:        %{name}-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ umbrello-4.12.1.tar.xz -> umbrello-4.12.2.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/CMakeLists.txt 
new/umbrello-4.12.2/CMakeLists.txt
--- old/umbrello-4.12.1/CMakeLists.txt  2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/CMakeLists.txt  2014-01-31 00:10:55.000000000 +0100
@@ -8,7 +8,7 @@
 
 set(VERSION_MAJOR "2")
 set(VERSION_MINOR "12")
-set(VERSION_PATCH "1")
+set(VERSION_PATCH "3")
 
 # set default umbrello version
 # umbrello version could be overriden by cmake command line using 
-DUMBRELLO_VERSION_STRING=major.minor.patch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/CMakeLists.txt 
new/umbrello-4.12.2/umbrello/CMakeLists.txt
--- old/umbrello-4.12.1/umbrello/CMakeLists.txt 2014-01-09 13:48:53.000000000 
+0100
+++ new/umbrello-4.12.2/umbrello/CMakeLists.txt 2014-01-31 00:10:55.000000000 
+0100
@@ -267,37 +267,21 @@
     codeimport/csharp/csharpimport.cpp
 )
 
-if (WIN32 AND NOT MSVC)
-    # SunPRO CC have a problem with position.h; we try to put a
-    # QChar into a spirit iterator, which, after a bunch of futzing, ends up in
-    # the STL string_ref templates, which use
-    #
-    #     union {
-    #        size_type _C_size;    // Number of actual data values stored
-    #        _CharT    _C_dummy;   // force the alignment of the first char
-    #     } _C_size;               // named to work around an HP aCC 3.30 bug
-    #
-    # and you can't have a class which requires an initializer in a union.
-    #
-    add_definitions(-DDISABLE_CPP_IMPORT)
-    set(libkdevcppparser_SRCS)
-else (WIN32 AND NOT MSVC)
-    list(APPEND libcodeimport_SRCS
-        codeimport/cppimport.cpp
-    )
-    set(libkdevcppparser_SRCS
-        codeimport/kdevcppparser/ast.cpp
-        codeimport/kdevcppparser/driver.cpp
-        codeimport/kdevcppparser/errors.cpp
-        codeimport/kdevcppparser/lexer.cpp
-        codeimport/kdevcppparser/lookup.cpp
-        codeimport/kdevcppparser/parser.cpp
-        codeimport/kdevcppparser/preprocesslexer.cpp
-        codeimport/kdevcppparser/tree_parser.cpp
-        codeimport/kdevcppparser/ast_utils.cpp
-        codeimport/kdevcppparser/cpptree2uml.cpp
-    )
-endif(WIN32 AND NOT MSVC)
+list(APPEND libcodeimport_SRCS
+    codeimport/cppimport.cpp
+)
+set(libkdevcppparser_SRCS
+    codeimport/kdevcppparser/ast.cpp
+    codeimport/kdevcppparser/driver.cpp
+    codeimport/kdevcppparser/errors.cpp
+    codeimport/kdevcppparser/lexer.cpp
+    codeimport/kdevcppparser/lookup.cpp
+    codeimport/kdevcppparser/parser.cpp
+    codeimport/kdevcppparser/preprocesslexer.cpp
+    codeimport/kdevcppparser/tree_parser.cpp
+    codeimport/kdevcppparser/ast_utils.cpp
+    codeimport/kdevcppparser/cpptree2uml.cpp
+)
 
 set(libclipboard_SRCS
     clipboard/umldragdata.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/artifact.cpp 
new/umbrello-4.12.2/umbrello/artifact.cpp
--- old/umbrello-4.12.1/umbrello/artifact.cpp   2014-01-09 13:48:53.000000000 
+0100
+++ new/umbrello-4.12.2/umbrello/artifact.cpp   2014-01-31 00:10:55.000000000 
+0100
@@ -20,7 +20,7 @@
  * @param id     The unique id of the Concept.
  */
 UMLArtifact::UMLArtifact(const QString & name, Uml::ID::Type id)
-  : UMLCanvasObject(name, id),
+  : UMLPackage(name, id),
     m_drawAsType(defaultDraw)
 {
     m_BaseType = UMLObject::ot_Artifact;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/artifact.h 
new/umbrello-4.12.2/umbrello/artifact.h
--- old/umbrello-4.12.1/umbrello/artifact.h     2014-01-09 13:48:53.000000000 
+0100
+++ new/umbrello-4.12.2/umbrello/artifact.h     2014-01-31 00:10:55.000000000 
+0100
@@ -11,7 +11,7 @@
 #ifndef ARTIFACT_H
 #define ARTIFACT_H
 
-#include "umlcanvasobject.h"
+#include "package.h"
 
 /**
  * This class contains the non-graphical information required for a UML
@@ -24,7 +24,7 @@
  * @see UMLCanvasObject
  * Bugs and comments to umbrello-de...@kde.org or http://bugs.kde.org
  */
-class UMLArtifact : public UMLCanvasObject
+class UMLArtifact : public UMLPackage
 {
     Q_OBJECT
 public:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/codeimport/classimport.cpp 
new/umbrello-4.12.2/umbrello/codeimport/classimport.cpp
--- old/umbrello-4.12.1/umbrello/codeimport/classimport.cpp     2014-01-09 
13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/classimport.cpp     2014-01-31 
00:10:55.000000000 +0100
@@ -20,9 +20,7 @@
 #include "javaimport.h"
 #include "adaimport.h"
 #include "pascalimport.h"
-#ifndef DISABLE_CPP_IMPORT
 #include "cppimport.h"
-#endif
 #include "csharpimport.h"
 #include "codeimpthread.h"
 
@@ -52,13 +50,8 @@
         classImporter = new PascalImport(thread);
     else if (fileName.endsWith(QLatin1String(".cs")))
         classImporter = new CSharpImport(thread);
-#ifndef DISABLE_CPP_IMPORT
     else
         classImporter = new CppImport(thread);  // the default.
-#else
-    else 
-        classImporter = 0;
-#endif
     return classImporter;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/codeimport/import_utils.cpp 
new/umbrello-4.12.2/umbrello/codeimport/import_utils.cpp
--- old/umbrello-4.12.1/umbrello/codeimport/import_utils.cpp    2014-01-09 
13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/import_utils.cpp    2014-01-31 
00:10:55.000000000 +0100
@@ -37,6 +37,10 @@
 #include <QMap>
 #include <QRegExp>
 
+DEBUG_REGISTER_DISABLED(Import_Utils)
+#undef DBG_SRC
+#define DBG_SRC "Import_Utils"
+
 namespace Import_Utils {
 
 /**
@@ -182,15 +186,20 @@
         UMLArtifact *a = static_cast<UMLArtifact*>(o);
         a->setDrawAsType(UMLArtifact::file);
         a->setDoc(comment);
-        uDebug() << name << comment;
+        DEBUG(DBG_SRC) << name << comment;
         return o;
     }
     UMLFolder *logicalView = umldoc->rootFolder(Uml::ModelType::Logical);
     if (parentPkg == NULL) {
-        // uDebug() << "Import_Utils::createUMLObject(" << name
+        // DEBUG(DBG_SRC) << "Import_Utils::createUMLObject(" << name
         //     << "): parentPkg is NULL, assuming Logical View";
         parentPkg = logicalView;
     }
+    if (parentPkg->baseType() == UMLObject::ot_Artifact) {
+        DEBUG(DBG_SRC) << "Import_Utils::createUMLObject(" << name
+                       << "): Artifact as parent package is not supported yet, 
using Logical View";
+        parentPkg = logicalView;
+    }
     UMLObject * o = umldoc->findUMLObject(name, type, parentPkg);
     bNewUMLObjectWasCreated = false;
     if (o == NULL) {
@@ -363,7 +372,7 @@
     Uml::ProgrammingLanguage::Enum pl = UMLApp::app()->activeLanguage();
     if (! (ot == UMLObject::ot_Class ||
            (ot == UMLObject::ot_Interface && pl == 
Uml::ProgrammingLanguage::Java))) {
-        uDebug() << "insertAttribute: Don not know what to do with "
+        DEBUG(DBG_SRC) << "insertAttribute: Don not know what to do with "
                  << owner->name() << " (object type " << 
UMLObject::toString(ot) << ")";
         return NULL;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/driver.cpp 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/driver.cpp
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/driver.cpp    
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/driver.cpp    
2014-01-31 00:10:55.000000000 +0100
@@ -234,7 +234,7 @@
     lexer = &lex;
     setupLexer(&lex);
 
-    if (!lex.setSource(sourceProvider()->contents(fileName), 
PositionFilename(fileName)))
+    if (!lex.setSource( sourceProvider()->contents(fileName), fileName))
         return false;
 
     if(!onlyPreProcess){
@@ -342,6 +342,7 @@
     lexer->addSkipWord("QT_NC_MSGBOX");
     lexer->addSkipWord("Q_VARIANT_AS", SkipWordAndArguments);
     lexer->addSkipWord("CALLBACK_CALL_TYPE");
+    lexer->addSkipWord("Q_SLOTS");
 
     // flex
     lexer->addSkipWord("yyconst");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/lexer.cpp 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/lexer.cpp
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/lexer.cpp     
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/lexer.cpp     
2014-01-31 00:10:55.000000000 +0100
@@ -45,6 +45,7 @@
                 bool isalpha_(QChar const& c) { return isalpha_(c.toAscii()); }
                 bool isblank_(QChar const& c) { return isblank_(c.toAscii()); }
                 bool isdigit_(QChar const& c) { return isdigit_(c.toAscii()); }
+                bool isxdigit_(QChar const& c) { return 
isxdigit_(c.toAscii()); }
             }
         }
     }
@@ -195,7 +196,7 @@
 
         definition(numberLiteral const& self) {
             main =
-                (+ digit_p)
+                (ch_p('0') >> ch_p('x') >> + xdigit_p | + digit_p)
                 [ self.result_ = construct_<Token>(Token_number_literal, arg1, 
arg2)];
         }
     };
@@ -325,7 +326,7 @@
 }
 
 bool Lexer::setSource(const QString& source,
-                      PositionFilename const& p_filename)
+                      const QString& p_filename)
 {
     reset();
     m_preprocessLexer.setSource(source, p_filename);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/lexer.h 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/lexer.h
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/lexer.h       
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/lexer.h       
2014-01-31 00:10:55.000000000 +0100
@@ -70,7 +70,7 @@
                      const QString& str = QString())
     { m_preprocessLexer.addSkipWord(word, skipType, str); }
 
-    bool setSource(const QString& source, PositionFilename const& p_filename);
+    bool setSource(const QString& source, const QString& p_filename);
     void setRecordComments(bool record);
     Position currentPosition() const { return m_source.get_currentPosition(); }
 
@@ -131,7 +131,7 @@
             m_startLine = true;
         }
 
-        void set_filename(PositionFilename const& p_filename) { m_filename = 
p_filename; }
+        void set_filename(const QString& p_filename) { m_filename = 
p_filename; }
         void set_source(QString const& source) {
             m_ptr = CharIterator(source.data(),
                                  source.data() + source.length(),
@@ -144,7 +144,7 @@
         // setters
         void set_startLine(bool p) {m_startLine = p;}
     private:
-        PositionFilename m_filename;
+        QString m_filename;
         CharIterator m_ptr;
         const CharIterator m_endPtr;
         bool m_startLine;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/position.h 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/position.h
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/position.h    
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/position.h    
2014-01-31 00:10:55.000000000 +0100
@@ -20,22 +20,6 @@
 #ifndef POSITION_H
 #define POSITION_H
 
-#ifdef _MSC_VER //Q_CC_MSVC isn't defined here
-/*
-workaround for the following msvc error 
-...\Microsoft Visual Studio 8\VC\INCLUDE\xstring(2044) : error C2620: 
-    member 'std::basic_string<_Elem>::_Bxty::_Buf ' of union 
'std::basic_string<_Elem>::_Bxty' 
-    has user-defined constructor or non-trivial default constructor with [  
_Elem=QChar]
-...\Microsoft Visual Studio 8\VC\INCLUDE\xstring(2046) : see reference to 
class 
-    template instantiation 'std::basic_string<_Elem>::_Bxty' being compiled 
with [  _Elem=QChar]
-..\umbrello\umbrello\codeimport\kdevcppparser\position.h(49) : see reference 
to class 
-    template instantiation 'std::basic_string<_Elem>' being compiled with [  
_Elem=QChar]
-*/
-#define union struct 
-#include <xstring>
-#undef union 
-#endif
-
 #include <limits.h>
 #include <boost/version.hpp>
 #include <boost/spirit/include/classic.hpp>
@@ -43,35 +27,7 @@
 #include <QChar>
 #include <QDebug>
 
-typedef std::basic_string<QChar> PositionFilenameType;
-
-class PositionFilename : public PositionFilenameType
-{
-public:
-    PositionFilename()
-    {
-    }
-
-    explicit PositionFilename(const QString &p) : 
PositionFilenameType(p.data())
-    {
-    }
-
-    QString toString() const
-    {
-        QString result;
-        for(unsigned int i = 0; i < size(); i++)
-            result.append(at(i));
-        return result;
-    }
-};
-
-inline QDebug operator<<(QDebug out, const PositionFilename &p)
-{
-    out << p.toString();
-    return out;
-}
-
-typedef boost::spirit::classic::file_position_base<PositionFilename> 
PositionType;
+typedef boost::spirit::classic::file_position_base<QString> PositionType;
 
 class Position : public PositionType
 {
@@ -80,7 +36,7 @@
     {
     }
 
-    explicit Position(const PositionFilename &p) : PositionType(p)
+    explicit Position(const QString& fileName) : PositionType(fileName)
     {
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp   
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp   
2014-01-31 00:10:55.000000000 +0100
@@ -41,13 +41,11 @@
 
 #define PREPROCESSLEXER_DEBUG
 
-#ifdef Q_CC_MSVC
 template <class _Tp>
-struct _Identity : public std::unary_function<_Tp, _Tp> {
+struct identity : public std::unary_function<_Tp,_Tp> {
   _Tp& operator()(_Tp& __x) const { return __x; }
   const _Tp& operator()(const _Tp& __x) const { return __x; }
 };
-#endif
 
 template <class _Tp>
 struct tilde : public std::unary_function<_Tp, _Tp> {
@@ -193,7 +191,7 @@
 
         definition(numberLiteral const& self) {
             main =
-                (+ digit_p)
+                (ch_p('0') >> ch_p('x') >> + xdigit_p | + digit_p)
                 [ self.result_ = construct_<Token>(Token_number_literal, arg1, 
arg2)];
         }
     };
@@ -314,7 +312,7 @@
 }
 
 void PreprocessLexer::setSource(const QString& source,
-                                PositionFilename const& p_filename)
+                                const QString& p_filename)
 {
     reset();
     m_source.set_source(source, p_filename);
@@ -372,6 +370,20 @@
     }
 }
 
+int PreprocessLexer::evaluateMacro(const QString &token)
+{
+    if (!m_driver->hasMacro(token)) {
+        uError() << "undefined macro" << token;
+        return 0;
+    }
+    Macro &m = m_driver->macro(token);
+    QString value = m.body().trimmed();
+    PreprocessLexer lexer(m_driver);
+    lexer.setSource(value, token);
+    int result = lexer.macroExpression();
+    return result;
+}
+
 void PreprocessLexer::nextLine()
 {
     m_source.parse((*gr_whiteSpace)
@@ -391,8 +403,13 @@
         while (!m_source.parse(eol_p).hit) {
             Token tk;
             nextToken(tk);
-            if (tk.type() != -1)
+            if (tk.type() != -1) {
                 m_preprocessedString += tk.text();
+                // TODO: Find a generic way to handle not expanded macros
+                // which are combined into invalid c code like Q_OBJECTpublic;
+                if (tk.type() == Token_Q_OBJECT)
+                    m_preprocessedString += QLatin1Char(';');
+            }
             if (m_source.currentChar().isNull())
                 break;
         }
@@ -593,7 +610,7 @@
     if (!d.exists())
         d.mkdir(tempPath);
 
-    QString fileName = tempPath + '/' + 
currentPosition().file.toString().replace(QRegExp("[/:mn]"), "-");
+    QString fileName = tempPath + '/' + 
currentPosition().file.replace(QRegExp("[/:mn]"), "-");
     QFile f(fileName);
     if (f.open(QIODevice::WriteOnly | QIODevice::Text)) {
         QTextStream out(&f);
@@ -839,7 +856,7 @@
         if (!l_hit)
             result = 0;
     } else {
-        boost::function < int (int) > l_op = _Identity<int>();
+        boost::function < int (int) > l_op = identity<int>();
         if (m_source.parse(ch_p('+')
                            | ch_p('-')[var(l_op) = std::negate<int>()]
                            | ch_p('!')[var(l_op) = std::logical_not<int>()]
@@ -854,8 +871,7 @@
             m_source.parse(
                 identifier_pg[assignFunctorResult<1>
                               (result,
-                               boost::bind(&Driver::hasMacro, m_driver,
-                                           _1))]
+                               boost::bind(&PreprocessLexer::evaluateMacro, 
boost::ref(*this), _1))]
                 | numberLiteral_pg[assignFunctorResult<1>
                                    (result,
                                     boost::bind(&PreprocessLexer::toInt, _1))]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/preprocesslexer.h 
new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/preprocesslexer.h
--- old/umbrello-4.12.1/umbrello/codeimport/kdevcppparser/preprocesslexer.h     
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimport/kdevcppparser/preprocesslexer.h     
2014-01-31 00:10:55.000000000 +0100
@@ -27,6 +27,7 @@
   bool isalpha_(QChar const& c);
   bool isblank_(QChar const& c);
   bool isdigit_(QChar const& c);
+  bool isxdigit_(QChar const& c);
 }}}}
 
 // must be first for msvc (see position.h for more information)
@@ -201,11 +202,12 @@
     void addSkipWord(const QString& word, SkipType skipType = SkipWord,
                       const QString& str = QString());
     bool preprocess();
-    void setSource(const QString& source, PositionFilename const& p_filename);
+    void setSource(const QString& source, const QString& p_filename);
     void setRecordComments(bool record);
     QString const& preprocessedString() const {return m_preprocessedString;}
 private:
     static int toInt(const Token& token);
+    int evaluateMacro(const QString &token);
     void dumpToFile();
 
     void addDependence(std::pair<QString, int> const& p_wordAndScope) const {
@@ -280,7 +282,7 @@
             m_ptr = CharIterator();
         }
         void set_source(const QString& source,
-                        PositionFilename const& p_filename) {
+                        const QString& p_filename) {
             m_source = source;
             m_ptr = CharIterator(m_source.data(),
                                  m_source.data() + m_source.length(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimpwizard/codeimpstatuspage.cpp 
new/umbrello-4.12.2/umbrello/codeimpwizard/codeimpstatuspage.cpp
--- old/umbrello-4.12.1/umbrello/codeimpwizard/codeimpstatuspage.cpp    
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimpwizard/codeimpstatuspage.cpp    
2014-01-31 00:10:55.000000000 +0100
@@ -49,6 +49,7 @@
 CodeImpStatusPage::CodeImpStatusPage(QWidget *parent)
   : QWizardPage(parent),
     m_workDone(false),
+    m_savedUndoEnabled(false),
     m_index(0),
     m_savedlistViewVisible(false)
 #ifdef ENABLE_IMPORT_THREAD
@@ -137,6 +138,9 @@
     ui_textEditLogger->setHtml(i18np("<b>Code import of 1 file:</b><br>", 
"<b>Code import of %1 files:</b><br>", m_files.size()));
     m_index = 0;
     m_workDone = false;
+    m_savedUndoEnabled = UMLApp::app()->isUndoEnabled();
+    UMLApp::app()->enableUndo(false);
+
 #ifdef ENABLE_IMPORT_THREAD
     m_thread = new QThread;
     //connect(thread, SIGNAL(started()), this, SLOT(importCodeFile()));
@@ -195,6 +199,9 @@
 void CodeImpStatusPage::importCodeFinish()
 {
     UMLDoc* doc = UMLApp::app()->document();
+
+    UMLApp::app()->enableUndo(m_savedUndoEnabled);
+
     doc->setLoading(false);
     // Modification is set after the import is made, because the file was 
modified when adding the classes.
     // Allowing undo of the whole class importing. I think it eats a lot of 
memory.
@@ -229,6 +236,8 @@
     messageToLog(m_file.fileName(), i18n("importing file ... stopped<br>"));
     updateStatus(m_file.fileName(), i18n("Import stopped"));
 
+    UMLApp::app()->enableUndo(m_savedUndoEnabled);
+
     UMLDoc* doc = UMLApp::app()->document();
     doc->setLoading(false);
     // Modification is set after the import is made, because the file was 
modified when adding the classes.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/umbrello-4.12.1/umbrello/codeimpwizard/codeimpstatuspage.h 
new/umbrello-4.12.2/umbrello/codeimpwizard/codeimpstatuspage.h
--- old/umbrello-4.12.1/umbrello/codeimpwizard/codeimpstatuspage.h      
2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/codeimpwizard/codeimpstatuspage.h      
2014-01-31 00:10:55.000000000 +0100
@@ -53,6 +53,7 @@
 private:
     QList<QFileInfo> m_files; ///< list of files to import
     bool             m_workDone;
+    bool             m_savedUndoEnabled; ///< saved undo enabled state
     int              m_index; ///< index in m_files
     QFileInfo        m_file; ///< current file
     bool             m_savedlistViewVisible; ///< indicates previous state of 
list view
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/listpopupmenu.cpp 
new/umbrello-4.12.2/umbrello/listpopupmenu.cpp
--- old/umbrello-4.12.1/umbrello/listpopupmenu.cpp      2014-01-09 
13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/listpopupmenu.cpp      2014-01-31 
00:10:55.000000000 +0100
@@ -1833,8 +1833,8 @@
 
     if(m_TriggerObjectType == tot_View) {
         bool bCutState = UMLApp::app()->isCutCopyState();
-        setActionEnabled(mt_Undo, UMLApp::app()->isUndoEnabled());
-        setActionEnabled(mt_Redo, UMLApp::app()->isRedoEnabled());
+        setActionEnabled(mt_Undo, UMLApp::app()->isUndoActionEnabled());
+        setActionEnabled(mt_Redo, UMLApp::app()->isRedoActionEnabled());
         setActionEnabled(mt_Cut, bCutState);
         setActionEnabled(mt_Copy, bCutState);
         setActionEnabled(mt_Paste, UMLApp::app()->isPasteState());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/uml.cpp 
new/umbrello-4.12.2/umbrello/uml.cpp
--- old/umbrello-4.12.1/umbrello/uml.cpp        2014-01-09 13:48:53.000000000 
+0100
+++ new/umbrello-4.12.2/umbrello/uml.cpp        2014-01-31 00:10:55.000000000 
+0100
@@ -76,6 +76,7 @@
 
 // qt includes
 #include <QClipboard>
+#include <QDesktopWidget>
 #include <QDockWidget>
 #include <QKeyEvent>
 #include <QLabel>
@@ -1018,7 +1019,11 @@
     m_toolsbar->applySettings(m_config->group("workbar"));
     fileOpenRecent->loadEntries(m_config->group("Recent Files"));
     setImageMimeType(UmbrelloSettings::imageMimeType());
-    resize(UmbrelloSettings::geometry());
+    QSize size = UmbrelloSettings::geometry();
+    if (size.width() == -1 && size.height() == -1)
+        size = QApplication::desktop()->screenGeometry().size();
+    resize(size);
+    enableUndo(Settings::optionState().generalState.undo);
 }
 
 /**
@@ -1711,28 +1716,6 @@
 }
 
 /**
- * Set whether to allow Undo.
- * It will enable/disable the menu/toolbar options.
- *
- * @param enable    Set whether to allow printing.
- */
-void UMLApp::enableUndo(bool enable)
-{
-    editUndo->setEnabled(enable);
-}
-
-/**
- * Set whether to allow Redo.
- * It will enable/disable the menu/toolbar options.
- *
- * @param enable    Set whether to allow printing.
- */
-void UMLApp::enableRedo(bool enable)
-{
-    editRedo->setEnabled(enable);
-}
-
-/**
  * Initialize Qt's global clipboard support for the application.
  */
 void UMLApp::initClip()
@@ -1825,6 +1808,8 @@
     if (m_settingsDlg) {
         // we need this to sync both values
         Settings::OptionState& optionState = Settings::optionState();
+        enableUndo(optionState.generalState.undo);
+
         bool stackBrowsing = (m_layout->indexOf(m_tabWidget) != -1);
         bool tabBrowsing = optionState.generalState.tabdiagrams;
         DEBUG(DBG_SRC) << "stackBrowsing=" << stackBrowsing << " / 
tabBrowsing=" << tabBrowsing;
@@ -1872,43 +1857,90 @@
 }
 
 /**
+ * Returns the paste state.
+ *
+ * @return  True if Paste is enabled.
+ */
+bool UMLApp::isPasteState() const
+{
+    return editPaste->isEnabled();
+}
+
+/**
+ * Returns the state on Cut/Copy.
+ *
+ * @return  True if Cut/Copy is enabled.
+ */
+bool UMLApp::isCutCopyState() const
+{
+    return editCopy->isEnabled();
+}
+
+/**
+ * Returns the state of undo support.
+ *
+ * @return  True if undo is enabled.
+ */
+bool UMLApp::isUndoEnabled()
+{
+    return m_undoEnabled;
+
+}
+
+/**
+ * Set the state of undo support.
+ *
+ */
+void UMLApp::enableUndo(bool enable)
+{
+    m_undoEnabled = enable;
+    editRedo->setVisible(enable);
+    editUndo->setVisible(enable);
+    viewShowCmdHistory->setVisible(enable);
+    clearUndoStack();
+    slotShowCmdHistoryView(enable);
+}
+
+/**
  * Returns the undo state. Is used for popupmenu of a view.
  *
  * @return  True if Undo is enabled.
  */
-bool UMLApp::isUndoEnabled() const
+bool UMLApp::isUndoActionEnabled() const
 {
     return editUndo->isEnabled();
 }
 
 /**
- * Returns the redo state.
+ * Set whether to allow Undo.
+ * It will enable/disable the menu/toolbar options.
  *
- * @return  True if Redo is enabled. Is used for popupmenu of a view.
+ * @param enable    Set whether to allow printing.
  */
-bool UMLApp::isRedoEnabled() const
+void UMLApp::enableUndoAction(bool enable)
 {
-    return editRedo->isEnabled();
+    editUndo->setEnabled(enable);
 }
 
 /**
- * Returns the paste state.
+ * Returns the redo state.
  *
- * @return  True if Paste is enabled.
+ * @return  True if Redo is enabled. Is used for popupmenu of a view.
  */
-bool UMLApp::isPasteState() const
+bool UMLApp::isRedoActionEnabled() const
 {
-    return editPaste->isEnabled();
+    return editRedo->isEnabled();
 }
 
 /**
- * Returns the state on Cut/Copy.
+ * Set whether to allow Redo.
+ * It will enable/disable the menu/toolbar options.
  *
- * @return  True if Cut/Copy is enabled.
+ * @param enable    Set whether to allow printing.
  */
-bool UMLApp::isCutCopyState() const
+void UMLApp::enableRedoAction(bool enable)
 {
-    return editCopy->isEnabled();
+    editRedo->setEnabled(enable);
 }
 
 /**
@@ -3002,17 +3034,20 @@
  */
 void UMLApp::undo()
 {
+    if (!isUndoEnabled())
+        return;
+
     DEBUG(DBG_SRC) << m_pUndoStack->undoText() << " [" << 
m_pUndoStack->count() << "]";
     m_pUndoStack->undo();
 
     if (m_pUndoStack->canUndo()) {
-        UMLApp::app()->enableUndo(true);
+        UMLApp::app()->enableUndoAction(true);
     }
     else {
-        UMLApp::app()->enableUndo(false);
+        UMLApp::app()->enableUndoAction(false);
     }
 
-    UMLApp::app()->enableRedo(true);
+    UMLApp::app()->enableRedoAction(true);
 }
 
 /**
@@ -3020,17 +3055,20 @@
  */
 void UMLApp::redo()
 {
+    if (!isUndoEnabled())
+        return;
+
     DEBUG(DBG_SRC) << m_pUndoStack->redoText() << " [" << 
m_pUndoStack->count() << "]";
     m_pUndoStack->redo();
 
     if (m_pUndoStack->canRedo()) {
-        UMLApp::app()->enableRedo(true);
+        UMLApp::app()->enableRedoAction(true);
     }
     else {
-        UMLApp::app()->enableRedo(false);
+        UMLApp::app()->enableRedoAction(false);
     }
 
-    UMLApp::app()->enableUndo(true);
+    UMLApp::app()->enableUndoAction(true);
 }
 
 /**
@@ -3038,12 +3076,15 @@
  */
 void UMLApp::executeCommand(QUndoCommand* cmd)
 {
-    if (cmd != NULL) {
+    if (cmd == NULL)
+        return;
+    if (isUndoEnabled()) {
         m_pUndoStack->push(cmd);
         DEBUG(DBG_SRC) << cmd->text() << " [" << m_pUndoStack->count() << "]";
+        UMLApp::app()->enableUndoAction(true);
+    } else {
+        cmd->redo();
     }
-
-    UMLApp::app()->enableUndo(true);
 }
 
 /**
@@ -3051,6 +3092,9 @@
  */
 void UMLApp::beginMacro(const QString & text)
 {
+    if (!isUndoEnabled()) {
+        return;
+    }
     if (m_hasBegunMacro) {
         return;
     }
@@ -3064,6 +3108,9 @@
  */
 void UMLApp::endMacro()
 {
+    if (!isUndoEnabled()) {
+        return;
+    }
     if (m_hasBegunMacro) {
         m_pUndoStack->endMacro();
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/uml.h 
new/umbrello-4.12.2/umbrello/uml.h
--- old/umbrello-4.12.1/umbrello/uml.h  2014-01-09 13:48:53.000000000 +0100
+++ new/umbrello-4.12.2/umbrello/uml.h  2014-01-31 00:10:55.000000000 +0100
@@ -100,14 +100,19 @@
     void setModified(bool _m);
 
     void enablePrint(bool enable);
-    void enableUndo(bool enable);
-    void enableRedo(bool enable);
 
-    bool isUndoEnabled() const;
-    bool isRedoEnabled() const;
     bool isPasteState() const;
     bool isCutCopyState() const;
 
+    bool isUndoEnabled();
+    void enableUndo(bool enable);
+
+    bool isUndoActionEnabled() const;
+    void enableUndoAction(bool enable);
+
+    bool isRedoActionEnabled() const;
+    void enableRedoAction(bool enable);
+
     bool isSimpleCodeGeneratorActive();
 
     void setGenerator(CodeGenerator* gen, bool giveWarning = true);
@@ -428,6 +433,7 @@
     XhtmlGenerator* m_xhtmlGenerator;
 
     KUndoStack* m_pUndoStack;  ///< UndoStack used to store actions, to 
provide Undo/Redo feature.
+    bool m_undoEnabled; ///< Undo enabled flag
 
     bool m_hasBegunMacro;  ///< Macro creation flag.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/umbrello-4.12.1/umbrello/umldoc.cpp 
new/umbrello-4.12.2/umbrello/umldoc.cpp
--- old/umbrello-4.12.1/umbrello/umldoc.cpp     2014-01-09 13:48:53.000000000 
+0100
+++ new/umbrello-4.12.2/umbrello/umldoc.cpp     2014-01-31 00:10:55.000000000 
+0100
@@ -385,7 +385,7 @@
     setModified(false);
     initSaveTimer();
 
-    UMLApp::app()->enableUndo(false);
+    UMLApp::app()->enableUndoAction(false);
     UMLApp::app()->clearUndoStack();
 
     return true;
@@ -555,7 +555,7 @@
     m_bLoading = false;
     initSaveTimer();
 
-    UMLApp::app()->enableUndo(false);
+    UMLApp::app()->enableUndoAction(false);
     UMLApp::app()->clearUndoStack();
     // for compatibility
     addDefaultStereotypes();

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to