summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-10-19 22:04:48 +0200
committerAndi Fischer <[email protected]>2014-10-19 22:04:48 +0200
commit1ee818781d860608808f12df8b6df0c72b6cf1dd (patch)
tree1a83bf630fdcdc8a02c6e4c71cb704e4d9a4476d
parenta70a54788ddfa396f933db6aed7481abd4f5c10a (diff)
First compilable and buildable version of umbrello on KFT.
Some changes are questinable or not done by marking with FIXME KF5.
-rw-r--r--CMakeLists.txt101
-rw-r--r--lib/cppparser/ast.h6
-rw-r--r--lib/cppparser/driver.h2
-rw-r--r--lib/cppparser/lexer.cpp2
-rw-r--r--lib/cppparser/lexercache.h4
-rw-r--r--lib/interfaces/codemodel.h83
-rw-r--r--lib/interfaces/hashedstring.cpp4
-rw-r--r--lib/interfaces/hashedstring.h2
-rw-r--r--umbrello/CMakeLists.txt20
-rw-r--r--umbrello/clipboard/umldragdata.cpp2
-rw-r--r--umbrello/codegenerators/cpp/cppcodegenerationform.cpp2
-rw-r--r--umbrello/codeimport/cppimport.cpp2
-rw-r--r--umbrello/codeimport/idlimport.cpp8
-rw-r--r--umbrello/dialogs/codeviewerdialog.cpp14
-rw-r--r--umbrello/dialogs/codeviewerdialog.h4
-rw-r--r--umbrello/dialogs/dialogbase.cpp9
-rw-r--r--umbrello/dialogs/exportallviewsdialog.cpp6
-rw-r--r--umbrello/dialogs/exportallviewsdialog.h4
-rw-r--r--umbrello/dialogs/finddialog.cpp16
-rw-r--r--umbrello/dialogs/finddialog.h4
-rw-r--r--umbrello/dialogs/pages/associationgeneralpage.cpp4
-rw-r--r--umbrello/dialogs/pages/autolayoutoptionpage.cpp3
-rw-r--r--umbrello/dialogs/pages/classgeneralpage.cpp4
-rw-r--r--umbrello/dialogs/pages/classoptionspage.cpp4
-rw-r--r--umbrello/dialogs/pages/diagrampropertiespage.cpp1
-rw-r--r--umbrello/dialogs/pages/generaloptionpage.cpp20
-rw-r--r--umbrello/dialogs/pages/generaloptionpage.h6
-rw-r--r--umbrello/dialogs/pages/umlwidgetstylepage.cpp7
-rw-r--r--umbrello/dialogs/pages/umlwidgetstylepage.h4
-rw-r--r--umbrello/dialogs/parameterpropertiesdialog.cpp6
-rw-r--r--umbrello/dialogs/selectoperationdialog.cpp2
-rw-r--r--umbrello/dialogs/settingsdialog.cpp1
-rw-r--r--umbrello/dialogs/umlattributedialog.cpp2
-rw-r--r--umbrello/dialogs/umlentityattributedialog.cpp4
-rw-r--r--umbrello/dialogs/umlfiledialog.cpp21
-rw-r--r--umbrello/dialogs/umlfiledialog.h1
-rw-r--r--umbrello/dialogs/umloperationdialog.cpp4
-rw-r--r--umbrello/dialogs/umltemplatedialog.cpp2
-rw-r--r--umbrello/docgenerators/docbook2xhtmlgeneratorjob.cpp4
-rw-r--r--umbrello/docgenerators/docbook2xhtmlgeneratorjob.h7
-rw-r--r--umbrello/docgenerators/docbookgenerator.cpp38
-rw-r--r--umbrello/docgenerators/docbookgenerator.h13
-rw-r--r--umbrello/docgenerators/docbookgeneratorjob.cpp6
-rw-r--r--umbrello/docgenerators/xhtmlgenerator.cpp28
-rw-r--r--umbrello/docgenerators/xhtmlgenerator.h6
-rw-r--r--umbrello/dotgenerator.cpp10
-rw-r--r--umbrello/dotgenerator.h3
-rw-r--r--umbrello/import_argo.cpp10
-rw-r--r--umbrello/import_argo.h2
-rw-r--r--umbrello/layoutgenerator.cpp9
-rw-r--r--umbrello/listpopupmenu.cpp2
-rw-r--r--umbrello/main.cpp30
-rw-r--r--umbrello/petalnode.cpp4
-rw-r--r--umbrello/stereotype.cpp3
-rw-r--r--umbrello/toolbarstate.cpp2
-rw-r--r--umbrello/uml.cpp50
-rw-r--r--umbrello/uml.h11
-rw-r--r--umbrello/umlappprivate.h7
-rw-r--r--umbrello/umldoc.cpp4
-rw-r--r--umbrello/umllistview.cpp5
-rw-r--r--umbrello/umlviewimageexporterall.cpp2
-rw-r--r--umbrello/umlviewimageexportermodel.cpp23
-rw-r--r--umbrello/umlviewimageexportermodel.h8
-rw-r--r--umbrello/widgets/associationline.cpp2
-rw-r--r--umbrello/widgets/statusbartoolbutton.cpp2
-rw-r--r--umbrello/worktoolbar.cpp9
-rw-r--r--umbrello/worktoolbar.h4
67 files changed, 398 insertions, 297 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70e66b6..f40f979 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,15 +8,7 @@ cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
# we need some parts of the ECM CMake helpers
find_package(ECM 1.1.0 REQUIRED NO_MODULE)
-set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
-#set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
-
-set(QT_MIN_VERSION "5.2.0")
-find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
- Core
- Widgets
- Xml
- Test)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECompilerSettings)
@@ -25,6 +17,47 @@ include(FeatureSummary)
include(ECMInstallIcons)
include(ECMSetupVersion)
+# search packages used by Qt
+set(QT_MIN_VERSION "5.2.0")
+find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS
+ Core
+ DBus
+ Gui
+ PrintSupport
+ Svg
+ Test
+ Widgets
+ Xml
+)
+
+# search packages used by KDE
+find_package(KF5 REQUIRED COMPONENTS
+ Archive
+ Auth
+ Completion
+ Config
+ CoreAddons
+ DocTools
+ GuiAddons
+ I18n
+ IconThemes
+ Init
+ KDELibs4Support
+ KIO
+ Parts
+ Service
+ TextEditor
+ WindowSystem
+ WidgetsAddons
+ XmlGui
+)
+
+# use some compile flags
+add_definitions(
+ -DQT_NO_SIGNAL_SLOTS_KEYWORDS
+ -DQT_NO_URL_CAST_FROM_STRING
+)
+
# set default umbrello version
# umbrello version could be overridden by cmake command line using -DUMBRELLO_VERSION_STRING=major.minor.patch
if(NOT UMBRELLO_VERSION_STRING)
@@ -45,54 +78,38 @@ endif()
message(STATUS "Using umbrello version ${UMBRELLO_VERSION_STRING}")
add_definitions(-DUMBRELLO_VERSION_STRING="${UMBRELLO_VERSION_STRING}")
-# search packages used by KDE
-find_package(KF5 REQUIRED COMPONENTS
- Config
- DocTools
- GuiAddons
- I18n
- Init
- WindowSystem
- XmlGui
-)
-
message(STATUS "Using automoc4 version ${AUTOMOC4_VERSION}")
message(STATUS "Using cmake version ${CMAKE_VERSION}")
-# The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
-# definitions like _GNU_SOURCE that are needed on each platform.
-#set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_STRICT_ITERATORS)
-
find_package(LibXslt)
-#macro_log_feature(LIBXSLT_FOUND "LibXSLT" "A library to transform XMLfiles into other XML files" #"http://xmlsoft.org/XSLT" FALSE "" "Required to build Umbrello.")
+set_package_properties(LibXslt PROPERTIES
+ DESCRIPTION "A library to transform XMLfiles into other XML files."
+ URL "http://xmlsoft.org/XSLT"
+ TYPE REQUIRED)
+
find_package(LibXml2)
-#macro_log_feature(LIBXML2_FOUND "LibXML2" "Libraries used to develop XML applications" "http://xmlsoft.org" FALSE "" #"Required to build Umbrello.")
+set_package_properties(LibXml2 PROPERTIES
+ DESCRIPTION "Libraries used to develop XML applications."
+ URL "http://xmlsoft.org"
+ TYPE REQUIRED)
-add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
- ${CMAKE_INSTALL_PREFIX}/include/KF5 #FIXME
+ /opt/project-neon5/include/KF5/KConfigCore #FIXME
/opt/project-neon5/include/KF5/KConfigGui #FIXME
+ /opt/project-neon5/include/KF5/KConfigWidgets #FIXME
/opt/project-neon5/include/KF5/KDELibs4Support #FIXME
- /opt/project-neon5/include/KF5/KConfigCore #FIXME
- /opt/project-neon5/include/KF5/KWidgetsAddons #FIXME
- /opt/project-neon5/include/KF5/KI18n #FIXME
- /opt/project-neon5/include/KF5/KXmlGui #FIXME
- /opt/project-neon5/include/KF5/KCompletion #FIXME
+ /opt/project-neon5/include/KF5/KIOCore #FIXME
+ /opt/project-neon5/include/KF5/KIOFileWidgets #FIXME
+ /opt/project-neon5/include/KF5/KIOWidgets #FIXME
/opt/project-neon5/include/KF5/KTextWidgets #FIXME
/opt/project-neon5/include/KF5/SonnetUi #FIXME
- /opt/project-neon5/include/KF5/KAuth #FIXME
)
-message(STATUS "===========> ${CMAKE_INSTALL_PREFIX}")
-
-#macro_display_feature_log()
-
-#KDE4_NO_ENABLE_FINAL(umbrello)
if(LIBXSLT_FOUND AND LIBXML2_FOUND)
- add_subdirectory( umbrello )
- add_subdirectory( doc )
+ add_subdirectory(umbrello)
+ add_subdirectory(doc)
# do we build the unit tests
if(KDE4_BUILD_TESTS)
ENABLE_TESTING()
@@ -101,3 +118,5 @@ if(LIBXSLT_FOUND AND LIBXML2_FOUND)
endif(LIBXSLT_FOUND AND LIBXML2_FOUND)
set(KDE4_BUILD_TESTS ON) # for unit tests
+
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/lib/cppparser/ast.h b/lib/cppparser/ast.h
index 6274399..dca4ed0 100644
--- a/lib/cppparser/ast.h
+++ b/lib/cppparser/ast.h
@@ -20,7 +20,7 @@
#ifndef __ast_h
#define __ast_h
-#include <KSharedPtr>
+#include <QExplicitlySharedDataPointer>
#include <memory>
#include <QString>
@@ -1893,10 +1893,10 @@ private:
};
-class TranslationUnitAST: public AST, public KShared
+class TranslationUnitAST: public AST, public QSharedData
{
public:
- typedef KSharedPtr<TranslationUnitAST> Node;
+ typedef QExplicitlySharedDataPointer<TranslationUnitAST> Node;
enum { Type = NodeType_TranslationUnit };
DECLARE_ALLOC(TranslationUnitAST)
diff --git a/lib/cppparser/driver.h b/lib/cppparser/driver.h
index 487b8d6..99c9293 100644
--- a/lib/cppparser/driver.h
+++ b/lib/cppparser/driver.h
@@ -46,7 +46,7 @@ enum {
typedef QPair<QString, int> Dependence;
class ParsedFile;
-typedef KSharedPtr<ParsedFile> ParsedFilePointer;
+typedef QExplicitlySharedDataPointer<ParsedFile> ParsedFilePointer;
class ParsedFile: public AbstractParseResult
{
diff --git a/lib/cppparser/lexer.cpp b/lib/cppparser/lexer.cpp
index a52d4ed..a6b7e01 100644
--- a/lib/cppparser/lexer.cpp
+++ b/lib/cppparser/lexer.cpp
@@ -830,7 +830,7 @@ int Lexer::macroPrimary()
{
readWhiteSpaces(false);
int result = 0;
- switch (currentChar().toAscii()) {
+ switch (currentChar().toLatin1()) {
case '(':
nextChar();
result = macroExpression();
diff --git a/lib/cppparser/lexercache.h b/lib/cppparser/lexercache.h
index 540d0e5..4d48aa7 100644
--- a/lib/cppparser/lexercache.h
+++ b/lib/cppparser/lexercache.h
@@ -25,7 +25,7 @@
class LexerCache;
-class CachedLexedFile : public KShared, public CacheNode
+class CachedLexedFile : public QSharedData, public CacheNode
{
public:
///@todo add and manage the set of included files
@@ -113,7 +113,7 @@ private:
*/
};
-typedef KSharedPtr<CachedLexedFile> CachedLexedFilePointer;
+typedef QExplicitlySharedDataPointer<CachedLexedFile> CachedLexedFilePointer;
struct CachedLexedFilePointerCompare {
bool operator() (const CachedLexedFilePointer& lhs, const CachedLexedFilePointer& rhs) const
diff --git a/lib/interfaces/codemodel.h b/lib/interfaces/codemodel.h
index a005fc6..8595e28 100644
--- a/lib/interfaces/codemodel.h
+++ b/lib/interfaces/codemodel.h
@@ -28,11 +28,10 @@ Code Model - a memory symbol store.
#include "ast.h"
-#include <KSharedPtr>
-
-#include <qmap.h>
+#include <QExplicitlySharedDataPointer>
+#include <QMap>
#include <QStringList>
-#include <qvector.h>
+#include <QVector>
#include "hashedstring.h"
#include <iostream>
@@ -45,7 +44,7 @@ enum ParsedFileType {
CppParsedFile
};
-class AbstractParseResult : public KShared
+class AbstractParseResult : public QSharedData
{
public:
virtual ~AbstractParseResult() {}
@@ -56,7 +55,7 @@ public:
virtual ParsedFileType type() const = 0;
};
-typedef KSharedPtr<AbstractParseResult> ParseResultPointer;
+typedef QExplicitlySharedDataPointer<AbstractParseResult> ParseResultPointer;
using namespace std;
@@ -76,90 +75,90 @@ class TypeAliasModel;
/**
@class ItemDom
Safe pointer to the @ref CodeModelItem.
-This is a type definition: @code typedef KSharedPtr<CodeModelItem> ItemDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<CodeModelItem> ItemDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<CodeModelItem> ItemDom;
+typedef QExplicitlySharedDataPointer<CodeModelItem> ItemDom;
/**
@class FileDom
Safe pointer to the @ref FileModel.
-This is a type definition: @code typedef KSharedPtr<FileModel> FileDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<FileModel> FileDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<FileModel> FileDom;
+typedef QExplicitlySharedDataPointer<FileModel> FileDom;
/**
@class NamespaceDom
Safe pointer to the @ref NamespaceModel.
-This is a type definition: @code typedef KSharedPtr<NamespaceModel> NamespaceDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<NamespaceModel> NamespaceDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<NamespaceModel> NamespaceDom;
+typedef QExplicitlySharedDataPointer<NamespaceModel> NamespaceDom;
/**
@class ClassDom
Safe pointer to the @ref ClassModel.
-This is a type definition: @code typedef KSharedPtr<ClassModel> ClassDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<ClassModel> ClassDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<ClassModel> ClassDom;
+typedef QExplicitlySharedDataPointer<ClassModel> ClassDom;
/**
@class FunctionDom
Safe pointer to the @ref FunctionModel.
-This is a type definition: @code typedef KSharedPtr<FunctionModel> FunctionDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<FunctionModel> FunctionDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<FunctionModel> FunctionDom;
+typedef QExplicitlySharedDataPointer<FunctionModel> FunctionDom;
/**
@class FunctionDefinitionDom
Safe pointer to the @ref FunctionDefinitionModel.
-This is a type definition: @code typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<FunctionDefinitionModel> FunctionDefinitionDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom;
+typedef QExplicitlySharedDataPointer<FunctionDefinitionModel> FunctionDefinitionDom;
/**
@class VariableDom
Safe pointer to the @ref VariableModel.
-This is a type definition: @code typedef KSharedPtr<VariableModel> VariableDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<VariableModel> VariableDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<VariableModel> VariableDom;
+typedef QExplicitlySharedDataPointer<VariableModel> VariableDom;
/**
@class ArgumentDom
Safe pointer to the @ref ArgumentModel.
-This is a type definition: @code typedef KSharedPtr<ArgumentModel> ArgumentDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<ArgumentModel> ArgumentDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<ArgumentModel> ArgumentDom;
+typedef QExplicitlySharedDataPointer<ArgumentModel> ArgumentDom;
/**
@class EnumDom
Safe pointer to the @ref EnumModel.
-This is a type definition: @code typedef KSharedPtr<EnumModel> EnumDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<EnumModel> EnumDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<EnumModel> EnumDom;
+typedef QExplicitlySharedDataPointer<EnumModel> EnumDom;
/**
@class TypeAliasDom
Safe pointer to the @ref TypeAliasModel.
-This is a type definition: @code typedef KSharedPtr<TypeAliasModel> TypeAliasDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<TypeAliasModel> TypeAliasDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<TypeAliasModel> TypeAliasDom;
+typedef QExplicitlySharedDataPointer<TypeAliasModel> TypeAliasDom;
/**
@class EnumeratorDom
Safe pointer to the @ref EnumeratorModel.
-This is a type definition: @code typedef KSharedPtr<EnumeratorModel> EnumeratorDom; @endcode
+This is a type definition: @code typedef QExplicitlySharedDataPointer<EnumeratorModel> EnumeratorDom; @endcode
[email protected] QExplicitlySharedDataPointer
*/
-typedef KSharedPtr<EnumeratorModel> EnumeratorDom;
+typedef QExplicitlySharedDataPointer<EnumeratorModel> EnumeratorDom;
/**
@class ItemList
@@ -275,7 +274,7 @@ QStringList sortedNameList(const ItemList& lst)
}
/**
-Casts safe code model pointers (@p KSharedPtr<T> objects like
+Casts safe code model pointers (@p QExplicitlySharedDataPointer<T> objects like
FileDom, NamespaceDom, etc.) to the @p Result type.
Example:
@@ -286,7 +285,7 @@ ClassDom cl = model_cast<ClassDom>(ns);
@param x Object to cast.
*/
template <class Result, class T>
-Result model_cast(KSharedPtr<T> x)
+Result model_cast(QExplicitlySharedDataPointer<T> x)
{
Result r(static_cast<T*>(x));
return r;
@@ -462,7 +461,7 @@ variables, arguments, enums and enumerators, type aliases.
Instances of this class should be created using @ref CodeModel::create method but usually
it is better to create instances of derived classes like ClassModel, NamespaceModel, FileModel, etc.
*/
-class CodeModelItem: public KShared
+class CodeModelItem: public QSharedData
{
public:
/**A definition of safe pointer to the code model item.*/
diff --git a/lib/interfaces/hashedstring.cpp b/lib/interfaces/hashedstring.cpp
index a13d340..db4ff34 100644
--- a/lib/interfaces/hashedstring.cpp
+++ b/lib/interfaces/hashedstring.cpp
@@ -61,7 +61,7 @@ void HashedString::initHash()
}
-class HashedStringSetData : public KShared
+class HashedStringSetData : public QSharedData
{
public:
#ifdef USE_HASHMAP
@@ -177,7 +177,9 @@ void HashedStringSet::makeDataPrivate()
m_data = new HashedStringSetData();
return ;
}
+#if 0 //FIXME KF5
if (m_data.count() != 1)
+#endif
m_data = new HashedStringSetData(*m_data);
}
diff --git a/lib/interfaces/hashedstring.h b/lib/interfaces/hashedstring.h
index 57a7904..de7e364 100644
--- a/lib/interfaces/hashedstring.h
+++ b/lib/interfaces/hashedstring.h
@@ -126,7 +126,7 @@ public:
private:
friend class HashedStringSetGroup;
void makeDataPrivate();
- KSharedPtr<HashedStringSetData> m_data; //this implies some additional cost because KShared's destructor is virtual. Maybe change that by copying KShared without the virtual destructor.
+ QExplicitlySharedDataPointer<HashedStringSetData> m_data; //this implies some additional cost because QSharedData's destructor is virtual. Maybe change that by copying QSharedData without the virtual destructor.
friend HashedStringSet operator + (const HashedStringSet& lhs, const HashedStringSet& rhs);
};
diff --git a/umbrello/CMakeLists.txt b/umbrello/CMakeLists.txt
index e1812d2..fb9c5bc 100644
--- a/umbrello/CMakeLists.txt
+++ b/umbrello/CMakeLists.txt
@@ -432,6 +432,7 @@ set(libumbrello_SRCS
toolbarstateother.cpp
toolbarstatepool.cpp
uml.cpp
+ umlappprivate.cpp
umlattributelist.cpp
umlcanvasobject.cpp
umlclassifierlistitemlist.cpp
@@ -452,7 +453,6 @@ set(libumbrello_SRCS
uniqueid.cpp
usecase.cpp
worktoolbar.cpp
- umlappprivate.cpp
)
kconfig_add_kcfg_files(umbrello_SRCS umbrellosettings.kcfgc)
@@ -483,11 +483,23 @@ target_link_libraries(umbrello
Qt5::Xml
Qt5::DBus
Qt5::PrintSupport
+ Qt5::Svg
+ KF5::Archive
+ KF5::Auth
+ KF5::Completion
+# KF5::Config
KF5::CoreAddons
- KF5::Config
-# KF5::TextEditor
+ KF5::I18n
+ KF5::IconThemes
+ KF5::GuiAddons
+ KF5::TextEditor
+ KF5::WidgetsAddons
+ KF5::WindowSystem
+ KF5::XmlGui
+ ${LIBXSLT_LIBRARIES}
+ ${LIBXML2_LIBRARIES}
KF5::KDELibs4Support
- ${KDE4_KFILE_LIBS} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${KDE4_KTEXTEDITOR_LIBS})
+)
install(TARGETS umbrello ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files #############
diff --git a/umbrello/clipboard/umldragdata.cpp b/umbrello/clipboard/umldragdata.cpp
index f98a47c..55adda4 100644
--- a/umbrello/clipboard/umldragdata.cpp
+++ b/umbrello/clipboard/umldragdata.cpp
@@ -219,7 +219,7 @@ void UMLDragData::setUMLDataClip4(UMLObjectList& objects, UMLWidgetList& widgets
setData(QLatin1String("application/x-uml-clip4"), domDoc.toString().toUtf8());
QImage img = pngImage.toImage();
- int l_size = img.numBytes();
+ int l_size = img.byteCount();
QByteArray clipdata;
clipdata.resize(l_size);
QDataStream clipstream(&clipdata, QIODevice::WriteOnly);
diff --git a/umbrello/codegenerators/cpp/cppcodegenerationform.cpp b/umbrello/codegenerators/cpp/cppcodegenerationform.cpp
index 763a0fc..6a7cc7d 100644
--- a/umbrello/codegenerators/cpp/cppcodegenerationform.cpp
+++ b/umbrello/codegenerators/cpp/cppcodegenerationform.cpp
@@ -84,7 +84,7 @@ CPPCodeGenerationForm::~CPPCodeGenerationForm()
void CPPCodeGenerationForm::browseClicked()
{
QString button = sender()->objectName();
- QString file = KFileDialog::getOpenFileName(KUrl(), QLatin1String("*.h"), this, QLatin1String("Get Header File"));
+ QString file = KFileDialog::getOpenFileName(QUrl(), QLatin1String("*.h"), this, QLatin1String("Get Header File"));
if (file.isEmpty()) {
return;
diff --git a/umbrello/codeimport/cppimport.cpp b/umbrello/codeimport/cppimport.cpp
index 8adf6d0..a7629e0 100644
--- a/umbrello/codeimport/cppimport.cpp
+++ b/umbrello/codeimport/cppimport.cpp
@@ -93,7 +93,7 @@ void CppImport::feedTheModel(const QString& fileName)
}
}
ParsedFilePointer ast = ms_driver->translationUnit(fileName);
- if (ast.isNull()) {
+ if (!ast) {
uError() << fileName << " not found in list of parsed files";
return;
}
diff --git a/umbrello/codeimport/idlimport.cpp b/umbrello/codeimport/idlimport.cpp
index 07afcf0..c7a7369 100644
--- a/umbrello/codeimport/idlimport.cpp
+++ b/umbrello/codeimport/idlimport.cpp
@@ -24,11 +24,11 @@
#include "umlpackagelist.h"
// kde includes
-#include <KStandardDirs>
// qt includes
#include <QProcess>
#include <QRegExp>
+#include <QStandardPaths>
#include <QStringList>
#include <stdio.h>
@@ -49,17 +49,17 @@ IDLImport::IDLImport(CodeImpThread* thread) : NativeImportBase(QLatin1String("//
}
QStringList arguments;
- QString executable = KStandardDirs::findExe(QLatin1String("cpp"));
+ QString executable = QStandardPaths::findExecutable(QLatin1String("cpp"));
if (!executable.isEmpty()) {
arguments << QLatin1String("-C"); // -C means "preserve comments"
}
#ifdef Q_WS_WIN
else {
- executable = KStandardDirs::findExe(QLatin1String("cl"));
+ executable = QStandardPaths::findExecutable(QLatin1String("cl"));
if (executable.isEmpty()) {
QString path = QLatin1String(qgetenv("VS100COMNTOOLS").constData());
if (!path.isEmpty())
- executable = KStandardDirs::findExe(QLatin1String("cl"), path + QLatin1String("/../../VC/bin"));
+ executable = QStandardPaths::findExecutable(QLatin1String("cl"), path + QLatin1String("/../../VC/bin"));
}
if (!executable.isEmpty()) {
arguments << QLatin1String("-E"); // -E means "preprocess to stdout"
diff --git a/umbrello/dialogs/codeviewerdialog.cpp b/umbrello/dialogs/codeviewerdialog.cpp
index acb1e32..a5eaae5 100644
--- a/umbrello/dialogs/codeviewerdialog.cpp
+++ b/umbrello/dialogs/codeviewerdialog.cpp
@@ -26,16 +26,18 @@
#include <QTabWidget>
CodeViewerDialog::CodeViewerDialog (QWidget* parent, CodeDocument * doc,
- Settings::CodeViewerState state)
- : KDialog (parent), m_state(state)
+ Settings::CodeViewerState state)
+ : QDialog (parent), m_state(state)
{
setModal(false);
- setButtons(KDialog::Cancel);
- setupUi(mainWidget());
+#if 0 //FIXME KF5
+ setButtons(QDialog::Cancel);
setInitialSize(QSize(630, 730));
+#endif
+ setupUi(window());
initGUI();
addCodeDocument(doc);
- connect(this, SIGNAL(cancelClicked()), mainWidget(), SLOT(close()));
+ connect(this, SIGNAL(cancelClicked()), window(), SLOT(close()));
}
CodeViewerDialog::~CodeViewerDialog()
@@ -87,7 +89,7 @@ bool CodeViewerDialog::close()
// remember block show status
m_state.showHiddenBlocks = ui_showHiddenCodeCB->isChecked();
// run superclass close now
- return KDialog::close();
+ return QDialog::close();
}
/**
diff --git a/umbrello/dialogs/codeviewerdialog.h b/umbrello/dialogs/codeviewerdialog.h
index 84a62e1..7fb1069 100644
--- a/umbrello/dialogs/codeviewerdialog.h
+++ b/umbrello/dialogs/codeviewerdialog.h
@@ -16,6 +16,8 @@
#include "codeviewerstate.h"
#include "ui_codeviewerdialogbase.h"
+#include <QDialog>
+
class CodeDocument;
@@ -24,7 +26,7 @@ class CodeDocument;
* that works, and thats all we need. In the future, a re-write is mandated to
* bring a bit of beauty to this beast. -b.t.
*/
-class CodeViewerDialog : public KDialog, private Ui::CodeViewerDialogBase
+class CodeViewerDialog : public QDialog, private Ui::CodeViewerDialogBase
{
Q_OBJECT
public:
diff --git a/umbrello/dialogs/dialogbase.cpp b/umbrello/dialogs/dialogbase.cpp
index 074afd4..e25ad14 100644
--- a/umbrello/dialogs/dialogbase.cpp
+++ b/umbrello/dialogs/dialogbase.cpp
@@ -18,7 +18,7 @@
#include "umlwidgetstylepage.h"
#include <KFontChooser>
-#include <KLocale>
+#include <KLocalizedString>
#include <KPageDialog>
#include <KPageWidget>
@@ -41,6 +41,7 @@ DialogBase::DialogBase(QWidget *parent, bool withDefaultButton)
{
if (m_useDialog) {
m_pageDialog = new KPageDialog(parent);
+#if 0 //FIXME KF5
KDialog::ButtonCodes buttons = KDialog::Ok | KDialog::Apply | KDialog::Cancel | KDialog::Help;
if (withDefaultButton)
buttons |= KDialog::Default;
@@ -50,6 +51,7 @@ DialogBase::DialogBase(QWidget *parent, bool withDefaultButton)
m_pageDialog->setFaceType(KPageDialog::List);
m_pageDialog->setModal(true);
m_pageDialog->setHelp(QString::fromLatin1("umbrello/index.html"), QString());
+#endif
connect(m_pageDialog, SIGNAL(okClicked()), this, SLOT(slotOkClicked()));
connect(m_pageDialog, SIGNAL(applyClicked()), this, SLOT(slotApplyClicked()));
connect(m_pageDialog, SIGNAL(defaultClicked()), this, SLOT(slotDefaultClicked()));
@@ -134,8 +136,10 @@ void DialogBase::saveStylePageData(UMLWidget *widget)
void DialogBase::setCaption(const QString &caption)
{
+#if 0 //FIXME KF5
if (m_pageDialog)
m_pageDialog->setCaption(caption);
+#endif
}
void DialogBase::accept()
@@ -168,7 +172,10 @@ void DialogBase::addPage(KPageWidgetItem *page)
int DialogBase::spacingHint()
{
+#if 0 //FIXME KF5
return KDialog::spacingHint();
+#endif
+ return 0;
}
int DialogBase::exec()
diff --git a/umbrello/dialogs/exportallviewsdialog.cpp b/umbrello/dialogs/exportallviewsdialog.cpp
index a4743fe..341b72a 100644
--- a/umbrello/dialogs/exportallviewsdialog.cpp
+++ b/umbrello/dialogs/exportallviewsdialog.cpp
@@ -24,14 +24,14 @@
* @param parent The parent of the dialog.
* @param name The internal name.
*
- * @see KDialog::KDialog
+ * @see QDialog::QDialog
*/
ExportAllViewsDialog::ExportAllViewsDialog(QWidget* parent, const char* name)
- : KDialog(parent)
+ : QDialog(parent)
{
setObjectName(QString::fromLatin1(name));
setModal(false);
- setupUi(mainWidget());
+ setupUi(window());
// create and initialize m_imageType
m_imageType = new KFileFilterCombo(this);
diff --git a/umbrello/dialogs/exportallviewsdialog.h b/umbrello/dialogs/exportallviewsdialog.h
index 338334c..236da0d 100644
--- a/umbrello/dialogs/exportallviewsdialog.h
+++ b/umbrello/dialogs/exportallviewsdialog.h
@@ -13,6 +13,8 @@
// application specific includes
#include "ui_exportallviewsdialogbase.h"
+#include <QDialog>
+
// KDE forward declarations
class KFileFilterCombo;
@@ -24,7 +26,7 @@ class KFileFilterCombo;
* The KFileFilterCombo is declared here instead of in the .ui file because QT
* Designer and uic don't recognize it.
*/
-class ExportAllViewsDialog : public KDialog, private Ui::ExportAllViewsDialogBase
+class ExportAllViewsDialog : public QDialog, private Ui::ExportAllViewsDialogBase
{
Q_OBJECT
diff --git a/umbrello/dialogs/finddialog.cpp b/umbrello/dialogs/finddialog.cpp
index 41fe2a4..22966c0 100644
--- a/umbrello/dialogs/finddialog.cpp
+++ b/umbrello/dialogs/finddialog.cpp
@@ -11,16 +11,18 @@
#include "finddialog.h"
FindDialog::FindDialog(QWidget *parent) :
- KDialog(parent)
+ QDialog(parent)
{
- setupUi(mainWidget());
+ setupUi(window());
+#if 0 //FIXME KF5
setCaption(i18n("Find"));
setButtons(User1 | Cancel);
setDefaultButton(User1);
setButtonText(User1, i18n("Search"));
- setModal(true);
showButtonSeparator(true);
+#endif
+ setModal(true);
ui_treeView->setChecked(true);
}
@@ -45,14 +47,16 @@ FindDialog::Filter FindDialog::filter()
void FindDialog::slotButtonClicked(int button)
{
- if (button == KDialog::User1)
+#if 0 //FIXME KF5
+ if (button == QDialog::User1)
accept();
else
- KDialog::slotButtonClicked(button);
+ QDialog::slotButtonClicked(button);
+#endif
}
void FindDialog::showEvent(QShowEvent *event)
{
ui_searchTerm->setFocus();
- KDialog::showEvent(event);
+ QDialog::showEvent(event);
}
diff --git a/umbrello/dialogs/finddialog.h b/umbrello/dialogs/finddialog.h
index 3f87c53..d443b77 100644
--- a/umbrello/dialogs/finddialog.h
+++ b/umbrello/dialogs/finddialog.h
@@ -13,14 +13,14 @@
#include "ui_finddialog.h"
-#include <KDialog>
+#include <QDialog>
/**
* Class FindDialog provides the ui part for selecting find attributes.
*
* @author: Ralf Habacker <[email protected]>
*/
-class FindDialog : public KDialog, private Ui::FindDialog
+class FindDialog : public QDialog, private Ui::FindDialog
{
Q_OBJECT
diff --git a/umbrello/dialogs/pages/associationgeneralpage.cpp b/umbrello/dialogs/pages/associationgeneralpage.cpp
index 936fb2c..d013593 100644
--- a/umbrello/dialogs/pages/associationgeneralpage.cpp
+++ b/umbrello/dialogs/pages/associationgeneralpage.cpp
@@ -94,7 +94,9 @@ void AssociationGeneralPage::constructWidget()
m_pAssocNameLE = new KLineEdit(m_pAssociationWidget->name());
m_pAssocNameComB = new KComboBox(true, nameAndTypeGB);
+#if 0 //FIXME KF5
m_pAssocNameComB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
m_pAssocNameComB->setDuplicatesEnabled(false); // only allow one of each type in box
QWidget *nameInputWidget = m_pAssocNameLE;
@@ -176,7 +178,9 @@ void AssociationGeneralPage::constructWidget()
m_pTypeCB->setCompletedItems(m_AssocTypeStrings);
m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
m_pNameAndTypeLayout->addWidget(m_pTypeCB, 1, 1);
// document
diff --git a/umbrello/dialogs/pages/autolayoutoptionpage.cpp b/umbrello/dialogs/pages/autolayoutoptionpage.cpp
index 6f075e1..8105ab0 100644
--- a/umbrello/dialogs/pages/autolayoutoptionpage.cpp
+++ b/umbrello/dialogs/pages/autolayoutoptionpage.cpp
@@ -15,9 +15,8 @@
#include "layoutgenerator.h"
// kde includes
-#include <KFileDialog>
#include <KLineEdit>
-#include <KLocale>
+#include <KLocalizedString>
// qt includes
#include <QCheckBox>
diff --git a/umbrello/dialogs/pages/classgeneralpage.cpp b/umbrello/dialogs/pages/classgeneralpage.cpp
index 1e8d2eb..750da0c 100644
--- a/umbrello/dialogs/pages/classgeneralpage.cpp
+++ b/umbrello/dialogs/pages/classgeneralpage.cpp
@@ -278,7 +278,9 @@ ClassGeneralPage::ClassGeneralPage(UMLDoc* d, QWidget* parent, UMLObject* o)
// manage stereotypes
m_pStereoTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pStereoTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
Dialog_Utils::insertStereotypesSorted(m_pStereoTypeCB, m_pObject->stereotype());
m_doc->setLineWrapMode(QTextEdit::WidgetWidth);
@@ -392,7 +394,9 @@ ClassGeneralPage::ClassGeneralPage(UMLDoc* d, QWidget* parent, UMLWidget* widget
m_pNameLayout->addWidget(m_pStereoTypeCB, 1, 1);
m_pStereoTypeCB->setItemText(m_pStereoTypeCB->currentIndex(), widget->umlObject()->stereotype());
+#if 0 //FIXME KF5
m_pStereoTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
m_pInstanceL = new QLabel(this);
m_pInstanceL->setText(i18n("Instance name:"));
diff --git a/umbrello/dialogs/pages/classoptionspage.cpp b/umbrello/dialogs/pages/classoptionspage.cpp
index 5dff60c..4ddcaa2 100644
--- a/umbrello/dialogs/pages/classoptionspage.cpp
+++ b/umbrello/dialogs/pages/classoptionspage.cpp
@@ -270,7 +270,9 @@ void ClassOptionsPage::setupClassPageOption()
insertAttribScope(i18n("Private"));
insertAttribScope(i18n("Protected"));
m_attribScopeCB->setCurrentIndex(m_options->classState.defaultAttributeScope);
+#if 0 //FIXME KF5
m_attribScopeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
scopeLayout->addWidget(m_attribScopeCB, 0, 1);
m_operationScopeCB = new KComboBox(m_scopeGB);
@@ -278,7 +280,9 @@ void ClassOptionsPage::setupClassPageOption()
insertOperationScope(i18n("Private"));
insertOperationScope(i18n("Protected"));
m_operationScopeCB->setCurrentIndex(m_options->classState.defaultOperationScope);
+#if 0 //FIXME KF5
m_operationScopeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
scopeLayout->addWidget(m_operationScopeCB, 1, 1);
}
}
diff --git a/umbrello/dialogs/pages/diagrampropertiespage.cpp b/umbrello/dialogs/pages/diagrampropertiespage.cpp
index 837b4d0..4f753f9 100644
--- a/umbrello/dialogs/pages/diagrampropertiespage.cpp
+++ b/umbrello/dialogs/pages/diagrampropertiespage.cpp
@@ -18,6 +18,7 @@
#include "umlview.h"
// kde includes
+#include <KLocalizedString>
#include <KMessageBox>
// qt includes
diff --git a/umbrello/dialogs/pages/generaloptionpage.cpp b/umbrello/dialogs/pages/generaloptionpage.cpp
index 4c8b19e..a8f55e0 100644
--- a/umbrello/dialogs/pages/generaloptionpage.cpp
+++ b/umbrello/dialogs/pages/generaloptionpage.cpp
@@ -17,18 +17,18 @@
// kde includes
#include <KComboBox>
-#include <KDialog>
-#include <KIntSpinBox>
#include <KLineEdit>
-#include <KLocale>
+#include <KLocalizedString>
// qt includes
#include <QCheckBox>
+#include <QDialog>
#include <QGridLayout>
#include <QGroupBox>
#include <QLabel>
#include <QPushButton>
#include <QRadioButton>
+#include <QSpinBox>
/**
* Constructor.
@@ -38,7 +38,10 @@ GeneralOptionPage::GeneralOptionPage(QWidget* parent)
: DialogPageBase(parent)
{
Settings::OptionState &optionState = Settings::optionState();
- int spacingHint = static_cast<KDialog*>(parent)->spacingHint();
+#if 0 //FIXME KF5
+ int spacingHint = static_cast<QDialog*>(parent)->spacingHint();
+#endif
+ int spacingHint = 2;
// Set up undo setting
m_GeneralWidgets.miscGB = new QGroupBox(i18nc("miscellaneous group box", "Miscellaneous"), parent);
@@ -80,7 +83,10 @@ GeneralOptionPage::GeneralOptionPage(QWidget* parent)
m_GeneralWidgets.autosaveL = new QLabel(i18n("Select auto-save time interval (mins):"), m_GeneralWidgets.autosaveGB);
autosaveLayout->addWidget(m_GeneralWidgets.autosaveL, 1, 0);
- m_GeneralWidgets.timeISB = new KIntSpinBox(1, 600, 1, optionState.generalState.autosavetime, m_GeneralWidgets.autosaveGB);
+ m_GeneralWidgets.timeISB = new QSpinBox(m_GeneralWidgets.autosaveGB);
+ m_GeneralWidgets.timeISB->setRange(1, 600);
+ m_GeneralWidgets.timeISB->setSingleStep(1);
+ m_GeneralWidgets.timeISB->setValue(optionState.generalState.autosavetime);
m_GeneralWidgets.timeISB->setEnabled(optionState.generalState.autosave);
autosaveLayout->addWidget(m_GeneralWidgets.timeISB, 1, 1);
@@ -112,7 +118,9 @@ GeneralOptionPage::GeneralOptionPage(QWidget* parent)
startupLayout->addWidget(m_GeneralWidgets.startL, 1, 0);
m_GeneralWidgets.diagramKB = new KComboBox(m_GeneralWidgets.startupGB);
+#if 0 //FIXME KF5
m_GeneralWidgets.diagramKB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
startupLayout->addWidget(m_GeneralWidgets.diagramKB, 1, 1);
// start at 1 because we don't allow No Diagram any more
@@ -130,7 +138,9 @@ GeneralOptionPage::GeneralOptionPage(QWidget* parent)
startupLayout->addWidget(m_GeneralWidgets.defaultLanguageL, 2, 0);
m_GeneralWidgets.languageKB = new KComboBox(m_GeneralWidgets.startupGB);
+#if 0 //FIXME KF5
m_GeneralWidgets.languageKB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
startupLayout->addWidget(m_GeneralWidgets.languageKB, 2, 1);
int indexCounter = 0;
diff --git a/umbrello/dialogs/pages/generaloptionpage.h b/umbrello/dialogs/pages/generaloptionpage.h
index f0ca4e2..2060bad 100644
--- a/umbrello/dialogs/pages/generaloptionpage.h
+++ b/umbrello/dialogs/pages/generaloptionpage.h
@@ -13,12 +13,12 @@
#include "dialogpagebase.h"
-class KIntSpinBox;
class KLineEdit;
class KComboBox;
-class QGroupBox;
class QCheckBox;
+class QGroupBox;
class QLabel;
+class QSpinBox;
/**
* A dialog page to display auto layouts options
@@ -46,7 +46,7 @@ protected:
QGroupBox * autosaveGB;
QGroupBox * startupGB;
- KIntSpinBox * timeISB;
+ QSpinBox * timeISB;
KComboBox * diagramKB;
KComboBox * languageKB;
diff --git a/umbrello/dialogs/pages/umlwidgetstylepage.cpp b/umbrello/dialogs/pages/umlwidgetstylepage.cpp
index 25e4409..2ef3da0 100644
--- a/umbrello/dialogs/pages/umlwidgetstylepage.cpp
+++ b/umbrello/dialogs/pages/umlwidgetstylepage.cpp
@@ -19,7 +19,6 @@
#include <klocale.h>
#include <kcolorbutton.h>
-#include <KIntSpinBox>
#include <QCheckBox>
#include <QGridLayout>
@@ -27,6 +26,7 @@
#include <QLabel>
#include <QLayout>
#include <QPushButton>
+#include <QSpinBox>
#include <QVBoxLayout>
/**
@@ -161,7 +161,10 @@ void UMLWidgetStylePage::init()
m_lineWidthL = new QLabel(i18nc("line width", "Line &width:"), m_pStyleGB);
styleLayout->addWidget(m_lineWidthL, ++row, 0);
- m_lineWidthB = new KIntSpinBox(0, 10, 1, 0, m_pStyleGB);
+ m_lineWidthB = new QSpinBox(m_pStyleGB);
+ m_lineWidthB->setRange(0, 10);
+ m_lineWidthB->setSingleStep(1);
+ m_lineWidthB->setValue(0);
styleLayout->addWidget(m_lineWidthB, row, 1);
m_lineWidthDefaultB = new QPushButton(i18nc("default line width button", "Defa&ult"), m_pStyleGB) ;
diff --git a/umbrello/dialogs/pages/umlwidgetstylepage.h b/umbrello/dialogs/pages/umlwidgetstylepage.h
index 9f5ed56..f689545 100644
--- a/umbrello/dialogs/pages/umlwidgetstylepage.h
+++ b/umbrello/dialogs/pages/umlwidgetstylepage.h
@@ -21,11 +21,11 @@
*/
class WidgetBase;
class KColorButton;
-class KIntSpinBox;
class QLabel;
class QPushButton;
class QCheckBox;
class QGroupBox;
+class QSpinBox;
class UMLWidgetStylePage : public QWidget
{
@@ -75,7 +75,7 @@ protected:
KColorButton * m_pFillColorB;
KColorButton * m_BackgroundColorB;
KColorButton * m_GridDotColorB;
- KIntSpinBox * m_lineWidthB;
+ QSpinBox * m_lineWidthB;
private:
void init();
diff --git a/umbrello/dialogs/parameterpropertiesdialog.cpp b/umbrello/dialogs/parameterpropertiesdialog.cpp
index 5a80f77..19863ad 100644
--- a/umbrello/dialogs/parameterpropertiesdialog.cpp
+++ b/umbrello/dialogs/parameterpropertiesdialog.cpp
@@ -137,15 +137,19 @@ ParameterPropertiesDialog::ParameterPropertiesDialog(QWidget * parent, UMLDoc *
// manage types
m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
m_pTypeCB->setEditable(true);
+#if 0 //FIXME KF5
m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
-// m_pTypeCB->setCompleter(...);
+#endif
+ // m_pTypeCB->setCompleter(...);
if (attr) {
insertTypesSorted(attr->getTypeName());
}
// manage stereotypes
m_pStereoTypeCB->setDuplicatesEnabled(false); //only allow one of each type in box
+#if 0 //FIXME KF5
m_pStereoTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
if (m_pAtt) {
insertStereotypesSorted(m_pAtt->stereotype());
}
diff --git a/umbrello/dialogs/selectoperationdialog.cpp b/umbrello/dialogs/selectoperationdialog.cpp
index 4b4ea40..f9cda4d 100644
--- a/umbrello/dialogs/selectoperationdialog.cpp
+++ b/umbrello/dialogs/selectoperationdialog.cpp
@@ -81,7 +81,9 @@ SelectOperationDialog::SelectOperationDialog(UMLView *parent, UMLClassifier * c,
mainLayout->addWidget(m_pOpRB, 1, 0);
m_pOpCB = new KComboBox(m_pOpGB);
+#if 0 //FIXME KF5
m_pOpCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
m_pOpCB->setDuplicatesEnabled(false); // only allow one of each type in box
connect(m_pOpCB, SIGNAL(currentIndexChanged(int)), this, SLOT(slotIndexChanged(int)));
mainLayout->addWidget(m_pOpCB, 1, 1, 1, 2);
diff --git a/umbrello/dialogs/settingsdialog.cpp b/umbrello/dialogs/settingsdialog.cpp
index b474448..15d1b96 100644
--- a/umbrello/dialogs/settingsdialog.cpp
+++ b/umbrello/dialogs/settingsdialog.cpp
@@ -25,6 +25,7 @@
#include "layoutgenerator.h"
#include <kfiledialog.h>
+#include <klocale.h>
#include <kvbox.h>
//TODO don't do that, but it's better than hardcoded in the functions body
diff --git a/umbrello/dialogs/umlattributedialog.cpp b/umbrello/dialogs/umlattributedialog.cpp
index 51ee606..da2ff99 100644
--- a/umbrello/dialogs/umlattributedialog.cpp
+++ b/umbrello/dialogs/umlattributedialog.cpp
@@ -131,7 +131,9 @@ void UMLAttributeDialog::setupDialog()
}
m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
//now add the Concepts
insertTypesSorted(m_pAttribute->getTypeName());
diff --git a/umbrello/dialogs/umlentityattributedialog.cpp b/umbrello/dialogs/umlentityattributedialog.cpp
index b185e41..ee69f20 100644
--- a/umbrello/dialogs/umlentityattributedialog.cpp
+++ b/umbrello/dialogs/umlentityattributedialog.cpp
@@ -110,7 +110,9 @@ void UMLEntityAttributeDialog::setupDialog()
valuesLayout->addWidget(m_pAttributesL, 7, 0);
m_pAttributesCB = new KComboBox(true, m_pValuesGB);
+#if 0 //FIXME KF5
m_pAttributesCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
valuesLayout->addWidget(m_pAttributesCB, 7, 1);
m_pTypeL->setBuddy(m_pAttributesCB);
@@ -156,7 +158,9 @@ void UMLEntityAttributeDialog::setupDialog()
}
m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
insertTypesSorted(m_pEntityAttribute->getTypeName());
m_pNameLE->setFocus();
diff --git a/umbrello/dialogs/umlfiledialog.cpp b/umbrello/dialogs/umlfiledialog.cpp
index 061752a..ee5b0df 100644
--- a/umbrello/dialogs/umlfiledialog.cpp
+++ b/umbrello/dialogs/umlfiledialog.cpp
@@ -13,20 +13,25 @@
#include "umlviewimageexportermodel.h"
// kde includes
-#include <KMimeType>
-#include <klocalizedstring.h>
+#include <KLocalizedString>
+
+// qt includes
+#include <QMimeDatabase>
+#include <QMimeType>
static QStringList mime2KdeFilter(const QStringList &mimeTypes, QString *allExtensions = 0)
{
const KUrl emptyUrl;
QStringList kdeFilter;
QStringList allExt;
+ QMimeDatabase db;
foreach(const QString& mimeType, mimeTypes) {
- KMimeType::Ptr mime(KMimeType::mimeType(mimeType));
- if (mime) {
- allExt += mime->patterns();
- kdeFilter.append(mime->patterns().join(QLatin1String(" ")) + QLatin1Char('|') +
- mime->comment(emptyUrl));
+ QMimeType mime(db.mimeTypeForName(mimeType));
+ if (mime.isValid()) {
+ allExt += mime.globPatterns();
+ kdeFilter.append(mime.globPatterns().join(QLatin1String(" ")) + QLatin1Char('|') +
+//FIXME KF5 mime.comment(emptyUrl));
+ mime.comment());
}
else if (mimeType == QString::fromLatin1("image/x-dot")) {
allExt += QString::fromLatin1("*.dot");
@@ -58,7 +63,9 @@ int UMLFileDialog::exec()
void UMLFileDialog::setCaption(const QString &caption)
{
+#if 0 //FIXME KF5
m_dialog->setCaption(caption);
+#endif
}
void UMLFileDialog::setOperationMode(KFileDialog::OperationMode mode)
diff --git a/umbrello/dialogs/umlfiledialog.h b/umbrello/dialogs/umlfiledialog.h
index 0972573..22206e4 100644
--- a/umbrello/dialogs/umlfiledialog.h
+++ b/umbrello/dialogs/umlfiledialog.h
@@ -12,6 +12,7 @@
#define UMLFILEDIALOG_H
#include <kfiledialog.h>
+#include <kurl.h>
/**
* Wrapper class for KFileDialog supporting graphviz *.dot files.
diff --git a/umbrello/dialogs/umloperationdialog.cpp b/umbrello/dialogs/umloperationdialog.cpp
index 56bbd5c..f2c46e2 100644
--- a/umbrello/dialogs/umloperationdialog.cpp
+++ b/umbrello/dialogs/umloperationdialog.cpp
@@ -184,7 +184,9 @@ void UMLOperationDialog::setupDialog()
m_pDownButton->setEnabled(false);
m_pRtypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pRtypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
// add the return types
insertTypesSorted(m_operation->getTypeName());
@@ -214,7 +216,9 @@ void UMLOperationDialog::setupDialog()
// manage stereotypes
m_pStereoTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pStereoTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
insertStereotypesSorted(m_operation->stereotype());
// setup parm list box signals
diff --git a/umbrello/dialogs/umltemplatedialog.cpp b/umbrello/dialogs/umltemplatedialog.cpp
index 70b8ea4..27b47b9 100644
--- a/umbrello/dialogs/umltemplatedialog.cpp
+++ b/umbrello/dialogs/umltemplatedialog.cpp
@@ -85,7 +85,9 @@ void UMLTemplateDialog::setupDialog()
m_pTypeCB->setEditable(true);
m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box
+#if 0 //FIXME KF5
m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup);
+#endif
// m_pTypeCB->setCompleter(...);
insertTypesSorted(m_pTemplate->getTypeName());
diff --git a/umbrello/docgenerators/docbook2xhtmlgeneratorjob.cpp b/umbrello/docgenerators/docbook2xhtmlgeneratorjob.cpp
index e45c101..df9994e 100644
--- a/umbrello/docgenerators/docbook2xhtmlgeneratorjob.cpp
+++ b/umbrello/docgenerators/docbook2xhtmlgeneratorjob.cpp
@@ -29,7 +29,7 @@
#include <kstandarddirs.h>
#include <klocale.h>
-#include <QTextOStream>
+#include <QTextStream>
extern int xmlLoadExtDtdDefaultValue;
@@ -38,7 +38,7 @@ extern int xmlLoadExtDtdDefaultValue;
* @param docBookUrl The Url of the Docbook that is to be converted to XHtml
* @param parent Parent object for QThread constructor
*/
-Docbook2XhtmlGeneratorJob::Docbook2XhtmlGeneratorJob(KUrl& docBookUrl, QObject* parent)
+Docbook2XhtmlGeneratorJob::Docbook2XhtmlGeneratorJob(QUrl& docBookUrl, QObject* parent)
:QThread(parent), m_docbookUrl(docBookUrl)
{
}
diff --git a/umbrello/docgenerators/docbook2xhtmlgeneratorjob.h b/umbrello/docgenerators/docbook2xhtmlgeneratorjob.h
index 1a5108d..9235218 100644
--- a/umbrello/docgenerators/docbook2xhtmlgeneratorjob.h
+++ b/umbrello/docgenerators/docbook2xhtmlgeneratorjob.h
@@ -12,8 +12,7 @@
#define DOCBOOK2XHTMLGENERATORJOB_H
#include <QThread>
-
-#include <kurl.h>
+#include <QUrl>
/**
* This class is used to generate XHTML from Docbook.
@@ -28,13 +27,13 @@ class Docbook2XhtmlGeneratorJob : public QThread
{
Q_OBJECT
public:
- Docbook2XhtmlGeneratorJob(KUrl& docBookUrl, QObject* parent);
+ Docbook2XhtmlGeneratorJob(QUrl& docBookUrl, QObject* parent);
protected:
void run();
private:
- KUrl m_docbookUrl;
+ QUrl m_docbookUrl;
signals:
void xhtmlGenerated(const QString&);
diff --git a/umbrello/docgenerators/docbookgenerator.cpp b/umbrello/docgenerators/docbookgenerator.cpp
index 31b599e..1882ca8 100644
--- a/umbrello/docgenerators/docbookgenerator.cpp
+++ b/umbrello/docgenerators/docbookgenerator.cpp
@@ -33,11 +33,12 @@
* Constructor.
*/
DocbookGenerator::DocbookGenerator()
+ : m_docbookGeneratorJob(0),
+ m_pStatus(true),
+ m_pThreadFinished(false)
+
{
- umlDoc = UMLApp::app()->document();
- m_pStatus = true;
- m_pThreadFinished = false;
- docbookGeneratorJob = 0;
+ m_umlDoc = UMLApp::app()->document();
}
/**
@@ -58,7 +59,7 @@ DocbookGenerator::~DocbookGenerator()
*/
bool DocbookGenerator::generateDocbookForProject()
{
- KUrl url = umlDoc->url();
+ KUrl url = m_umlDoc->url();
QString fileName = url.fileName();
fileName.remove(QRegExp(QLatin1String(".xmi$")));
url.setFileName(fileName);
@@ -74,10 +75,10 @@ bool DocbookGenerator::generateDocbookForProject()
* @todo better handling of error conditions
* @return true if saving is successful and false otherwise.
*/
-void DocbookGenerator::generateDocbookForProjectInto(const KUrl& destDir)
+void DocbookGenerator::generateDocbookForProjectInto(const QUrl& destDir)
{
m_destDir = destDir;
- umlDoc->writeToStatusBar(i18n("Exporting all views..."));
+ m_umlDoc->writeToStatusBar(i18n("Exporting all views..."));
QStringList errors = UMLViewImageExporterModel().exportAllViews(
UMLViewImageExporterModel::mimeTypeToImageType(QLatin1String("image/png")), destDir, false);
@@ -86,30 +87,29 @@ void DocbookGenerator::generateDocbookForProjectInto(const KUrl& destDir)
return;
}
- umlDoc->writeToStatusBar(i18n("Generating Docbook..."));
+ m_umlDoc->writeToStatusBar(i18n("Generating Docbook..."));
- docbookGeneratorJob = new DocbookGeneratorJob(this);
- connect(docbookGeneratorJob, SIGNAL(docbookGenerated(QString)), this, SLOT(slotDocbookGenerationFinished(QString)));
- connect(docbookGeneratorJob, SIGNAL(finished()), this, SLOT(threadFinished()));
+ m_docbookGeneratorJob = new DocbookGeneratorJob(this);
+ connect(m_docbookGeneratorJob, SIGNAL(docbookGenerated(QString)), this, SLOT(slotDocbookGenerationFinished(QString)));
+ connect(m_docbookGeneratorJob, SIGNAL(finished()), this, SLOT(threadFinished()));
uDebug()<<"Threading";
- docbookGeneratorJob->start();
+ m_docbookGeneratorJob->start();
}
void DocbookGenerator::slotDocbookGenerationFinished(const QString& tmpFileName)
{
uDebug() << "Generation Finished" << tmpFileName;
- KUrl url = umlDoc->url();
+ QUrl url = m_umlDoc->url();
QString fileName = url.fileName();
fileName.replace(QRegExp(QLatin1String(".xmi$")), QLatin1String(".docbook"));
- url.setPath(m_destDir.path());
- url.addPath(fileName);
+ url.setPath(m_destDir.path() + QLatin1Char('/') + fileName);
KIO::Job* job = KIO::file_copy(KUrl::fromPath(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo);
if (KIO::NetAccess::synchronousRun(job, (QWidget*)UMLApp::app())) {
- umlDoc->writeToStatusBar(i18n("Docbook Generation Complete..."));
+ m_umlDoc->writeToStatusBar(i18n("Docbook Generation Complete..."));
m_pStatus = true;
} else {
- umlDoc->writeToStatusBar(i18n("Docbook Generation Failed..."));
+ m_umlDoc->writeToStatusBar(i18n("Docbook Generation Failed..."));
m_pStatus = false;
}
@@ -124,6 +124,6 @@ void DocbookGenerator::slotDocbookGenerationFinished(const QString& tmpFileName)
void DocbookGenerator::threadFinished()
{
m_pThreadFinished = true;
- delete docbookGeneratorJob;
- docbookGeneratorJob = 0;
+ delete m_docbookGeneratorJob;
+ m_docbookGeneratorJob = 0;
}
diff --git a/umbrello/docgenerators/docbookgenerator.h b/umbrello/docgenerators/docbookgenerator.h
index cadee37..2892c9a 100644
--- a/umbrello/docgenerators/docbookgenerator.h
+++ b/umbrello/docgenerators/docbookgenerator.h
@@ -12,11 +12,11 @@
#ifndef DOCBOOKGENERATOR_H
#define DOCBOOKGENERATOR_H
-#include <kurl.h>
#include <QObject>
+#include <QUrl>
-class UMLDoc;
class DocbookGeneratorJob;
+class UMLDoc;
/**
* class DocbookGenerator is a documentation generator for UML documents.
@@ -37,7 +37,7 @@ class DocbookGenerator : public QObject
virtual ~DocbookGenerator();
bool generateDocbookForProject();
- void generateDocbookForProjectInto(const KUrl& destDir);
+ void generateDocbookForProjectInto(const QUrl& destDir);
signals:
@@ -51,12 +51,11 @@ class DocbookGenerator : public QObject
private:
- DocbookGeneratorJob* docbookGeneratorJob;
-
+ DocbookGeneratorJob* m_docbookGeneratorJob;
bool m_pStatus;
bool m_pThreadFinished;
- KUrl m_destDir;
- UMLDoc* umlDoc;
+ QUrl m_destDir;
+ UMLDoc* m_umlDoc;
};
#endif // DOCBOOKGENERATOR_H
diff --git a/umbrello/docgenerators/docbookgeneratorjob.cpp b/umbrello/docgenerators/docbookgeneratorjob.cpp
index 25e2147..6d1a3e4 100644
--- a/umbrello/docgenerators/docbookgeneratorjob.cpp
+++ b/umbrello/docgenerators/docbookgeneratorjob.cpp
@@ -29,12 +29,12 @@
#include <kstandarddirs.h>
#include <klocale.h>
-#include <QTextOStream>
+#include <QTextStream>
extern int xmlLoadExtDtdDefaultValue;
-DocbookGeneratorJob::DocbookGeneratorJob(QObject* parent):
- QThread(parent)
+DocbookGeneratorJob::DocbookGeneratorJob(QObject* parent)
+ : QThread(parent)
{
}
diff --git a/umbrello/docgenerators/xhtmlgenerator.cpp b/umbrello/docgenerators/xhtmlgenerator.cpp
index 5e14879..5033904 100644
--- a/umbrello/docgenerators/xhtmlgenerator.cpp
+++ b/umbrello/docgenerators/xhtmlgenerator.cpp
@@ -58,10 +58,10 @@ XhtmlGenerator::~XhtmlGenerator()
*/
bool XhtmlGenerator::generateXhtmlForProject()
{
- KUrl url = m_umlDoc->url();
+ QUrl url = m_umlDoc->url();
QString fileName = url.fileName();
fileName.remove(QRegExp(QLatin1String(".xmi$")));
- url.setFileName(fileName);
+ url.setPath(fileName);
uDebug() << "Exporting to directory: " << url;
return generateXhtmlForProjectInto(url);
}
@@ -73,11 +73,11 @@ bool XhtmlGenerator::generateXhtmlForProject()
* @todo better handling of error conditions
* @return true if saving is successful and false otherwise.
*/
-bool XhtmlGenerator::generateXhtmlForProjectInto(const KUrl& destDir)
+bool XhtmlGenerator::generateXhtmlForProjectInto(const QUrl& destDir)
{
uDebug() << "First convert to docbook";
m_destDir = destDir;
-// KUrl url(QString("file://")+m_tmpDir.name());
+// QUrl url(QString("file://") + m_tmpDir.name());
DocbookGenerator* docbookGenerator = new DocbookGenerator;
docbookGenerator->generateDocbookForProjectInto(destDir);
@@ -99,11 +99,10 @@ void XhtmlGenerator::slotDocbookToXhtml(bool status)
return;
}
else {
- KUrl url = m_umlDoc->url();
+ QUrl url = m_umlDoc->url();
QString fileName = url.fileName();
fileName.replace(QRegExp(QLatin1String(".xmi$")), QLatin1String(".docbook"));
- url.setPath(m_destDir.path());
- url.addPath(fileName);
+ url.setPath(m_destDir.path() + QLatin1Char('/') + fileName);
m_umlDoc->writeToStatusBar(i18n("Generating XHTML..."));
m_d2xg = new Docbook2XhtmlGeneratorJob(url, this);
@@ -123,13 +122,12 @@ void XhtmlGenerator::slotDocbookToXhtml(bool status)
void XhtmlGenerator::slotHtmlGenerated(const QString& tmpFileName)
{
uDebug() << "HTML Generated " << tmpFileName;
- KUrl url = m_umlDoc->url();
+ QUrl url = m_umlDoc->url();
QString fileName = url.fileName();
fileName.replace(QRegExp(QLatin1String(".xmi$")), QLatin1String(".html"));
- url.setPath(m_destDir.path());
- url.addPath(fileName);
+ url.setPath(m_destDir.path() + QLatin1Char('/') + fileName);
- KIO::Job* htmlCopyJob = KIO::file_copy(KUrl::fromPath(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo);
+ KIO::Job* htmlCopyJob = KIO::file_copy(QUrl::fromLocalFile(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo);
if (KIO::NetAccess::synchronousRun(htmlCopyJob, (QWidget*)UMLApp::app())) {
m_umlDoc->writeToStatusBar(i18n("XHTML Generation Complete..."));
} else {
@@ -139,10 +137,10 @@ void XhtmlGenerator::slotHtmlGenerated(const QString& tmpFileName)
m_umlDoc->writeToStatusBar(i18n("Copying CSS..."));
- QString cssFileName(KGlobal::dirs()->findResource("appdata", QLatin1String("xmi.css")));
- KUrl cssUrl = m_destDir;
- cssUrl.addPath(QLatin1String("xmi.css"));
- KIO::Job* cssJob = KIO::file_copy(cssFileName, cssUrl, -1, KIO::Overwrite | KIO::HideProgressInfo);
+ QString cssFileName(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("xmi.css")));
+ QUrl cssUrl = m_destDir;
+ cssUrl.setPath(cssUrl.path() + QLatin1Char('/') + QLatin1String("xmi.css"));
+ KIO::Job* cssJob = KIO::file_copy(QUrl::fromLocalFile(cssFileName), cssUrl, -1, KIO::Overwrite | KIO::HideProgressInfo);
if (KIO::NetAccess::synchronousRun(cssJob, (QWidget*)UMLApp::app())) {
m_umlDoc->writeToStatusBar(i18n("Finished Copying CSS..."));
diff --git a/umbrello/docgenerators/xhtmlgenerator.h b/umbrello/docgenerators/xhtmlgenerator.h
index 75de91d..c17bbb4 100644
--- a/umbrello/docgenerators/xhtmlgenerator.h
+++ b/umbrello/docgenerators/xhtmlgenerator.h
@@ -12,10 +12,10 @@
#ifndef XHTMLGENERATOR_H
#define XHTMLGENERATOR_H
-#include <kurl.h>
#include <ktempdir.h>
#include <QObject>
+#include <QUrl>
class UMLDoc;
@@ -41,7 +41,7 @@ public:
virtual ~XhtmlGenerator();
bool generateXhtmlForProject();
- bool generateXhtmlForProjectInto(const KUrl& destDir);
+ bool generateXhtmlForProjectInto(const QUrl& destDir);
signals:
@@ -61,7 +61,7 @@ private:
bool m_pStatus;
bool m_pThreadFinished;
- KUrl m_destDir; ///< Destination directory where the final documentation will be written.
+ QUrl m_destDir; ///< Destination directory where the final documentation will be written.
UMLDoc* m_umlDoc;
};
diff --git a/umbrello/dotgenerator.cpp b/umbrello/dotgenerator.cpp
index 2ada2c7..92e7b9c 100644
--- a/umbrello/dotgenerator.cpp
+++ b/umbrello/dotgenerator.cpp
@@ -23,7 +23,6 @@
// kde includes
#include <KConfigGroup>
#include <KDesktopFile>
-#include <KStandardDirs>
// qt includes
#include <QFile>
@@ -31,7 +30,8 @@
#include <QProcess>
#include <QRectF>
#include <QRegExp>
-#include <QString>
+#include <QStandardPaths>
+#include <QStringList>
#include <QTemporaryFile>
#include <QTextStream>
@@ -185,9 +185,7 @@ void DotGenerator::setUseFullNodeLabels(bool state)
bool DotGenerator::availableConfigFiles(UMLScene *scene, QHash<QString, QString> &configFiles)
{
QString diagramType = Uml::DiagramType::toString(scene->type()).toLower();
- KStandardDirs dirs;
-
- QStringList fileNames = dirs.findAllResources("data", QString::fromLatin1("umbrello/layouts/%1*.desktop").arg(diagramType));
+ QStringList fileNames = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("umbrello/layouts/%1*.desktop").arg(diagramType));
foreach(const QString &fileName, fileNames) {
QFileInfo fi(fileName);
QString baseName;
@@ -221,7 +219,7 @@ bool DotGenerator::readConfigFile(QString diagramType, const QString &variant)
QString configFileName;
foreach(const QString &fileName, fileNames) {
- configFileName = KStandardDirs::locate("data", QString::fromLatin1("umbrello/layouts/%1").arg(fileName));
+ configFileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString::fromLatin1("umbrello/layouts/%1").arg(fileName));
if (!configFileName.isEmpty())
break;
}
diff --git a/umbrello/dotgenerator.h b/umbrello/dotgenerator.h
index fb5508c..04c9932 100644
--- a/umbrello/dotgenerator.h
+++ b/umbrello/dotgenerator.h
@@ -13,6 +13,9 @@
class UMLScene;
#include <QHash>
#include <QPointF>
+#include <QString>
+
+class QStringList;
#define DOTGENERATOR_DEBUG
/**
diff --git a/umbrello/import_argo.cpp b/umbrello/import_argo.cpp
index 2ef1c00..f811709 100644
--- a/umbrello/import_argo.cpp
+++ b/umbrello/import_argo.cpp
@@ -18,12 +18,12 @@
// kde includes
#include <klocale.h>
-#include <KTempDir>
#include <KZip>
// qt includes
#include <QFile>
#include <QStringList>
+#include <QTemporaryDir>
#include <QXmlStreamReader>
static void reportError(const QXmlStreamReader &xml, const KZip &zipFile, const QString &fileName)
@@ -42,7 +42,7 @@ bool Import_Argo::loadFromArgoFile(const KZip &zipFile, const QString &fileName)
while (!xml.atEnd()) {
xml.readNext();
- if (xml.name() == "member") {
+ if (xml.name() == QLatin1String("member")) {
QXmlStreamAttributes attributes = xml.attributes();
QString type = attributes.value(QLatin1String("type")).toString();
QString name = attributes.value(QLatin1String("name")).toString();
@@ -109,11 +109,11 @@ bool Import_Argo::loadFromXMIFile(const KZip &zipFile, const QString &fileName)
if (!file)
return false;
- KTempDir tmpDir;
+ QTemporaryDir tmpDir;
tmpDir.setAutoRemove(true);
- file->copyTo(tmpDir.name());
+ file->copyTo(tmpDir.path());
- QFile xmiFile(tmpDir.name() + file->name());
+ QFile xmiFile(tmpDir.path() + QLatin1Char('/') + file->name());
if(!xmiFile.open(QIODevice::ReadOnly)) {
return false;
}
diff --git a/umbrello/import_argo.h b/umbrello/import_argo.h
index 7e49ad8..6bb5d10 100644
--- a/umbrello/import_argo.h
+++ b/umbrello/import_argo.h
@@ -11,7 +11,7 @@
#ifndef IMPORT_ARGO_H
#define IMPORT_ARGO_H
-#include <qiodevice.h>
+#include <QIODevice>
class UMLPackage;
class KZip;
diff --git a/umbrello/layoutgenerator.cpp b/umbrello/layoutgenerator.cpp
index 4bb6c1a..e53ffc0 100644
--- a/umbrello/layoutgenerator.cpp
+++ b/umbrello/layoutgenerator.cpp
@@ -21,8 +21,7 @@
// kde includes
#include <KConfigGroup>
#include <KDesktopFile>
-#include <KLocale>
-#include <KStandardDirs>
+#include <KLocalizedString>
// qt includes
#include <QDir>
@@ -31,6 +30,7 @@
#include <QProcess>
#include <QRegExp>
#include <QString>
+#include <QStandardPaths>
#include <QTemporaryFile>
//#include <QTextStream>
@@ -99,7 +99,7 @@ bool LayoutGenerator::isEnabled()
*/
QString LayoutGenerator::currentDotPath()
{
- QString executable = KStandardDirs::findExe(QLatin1String("dot"));
+ QString executable = QStandardPaths::findExecutable(QLatin1String("dot"));
if (!executable.isEmpty()) {
QFileInfo fi(executable);
return fi.absolutePath();
@@ -284,9 +284,8 @@ bool LayoutGenerator::apply(UMLScene *scene)
bool LayoutGenerator::availableConfigFiles(UMLScene *scene, QHash<QString,QString> &configFiles)
{
QString diagramType = Uml::DiagramType::toString(scene->type()).toLower();
- KStandardDirs dirs;
- QStringList fileNames = dirs.findAllResources("data", QString::fromLatin1("umbrello/layouts/%1*.desktop").arg(diagramType));
+ QStringList fileNames = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("umbrello/layouts/%1*.desktop").arg(diagramType));
foreach(const QString &fileName, fileNames) {
QFileInfo fi(fileName);
QString baseName;
diff --git a/umbrello/listpopupmenu.cpp b/umbrello/listpopupmenu.cpp
index b914624..8cfb06c 100644
--- a/umbrello/listpopupmenu.cpp
+++ b/umbrello/listpopupmenu.cpp
@@ -1336,7 +1336,7 @@ ListPopupMenu* ListPopupMenu::menuFromAction(QAction *action)
{
if (action) {
QVariant value = dataFromAction(dt_MenuPointer, action);
- if (qVariantCanConvert<ListPopupMenu*>(value)) {
+ if (value.canConvert<ListPopupMenu*>()) {
return qvariant_cast<ListPopupMenu*>(value);
}
}
diff --git a/umbrello/main.cpp b/umbrello/main.cpp
index ddfd649..005c44d 100644
--- a/umbrello/main.cpp
+++ b/umbrello/main.cpp
@@ -22,7 +22,7 @@
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
-#include <klocale.h>
+#include <klocalizedstring.h>
#include <ktip.h>
#include <kwindowsystem.h>
@@ -30,12 +30,6 @@
#include <stdio.h>
/**
- * Description for this application
- */
-static const char description[] =
- I18N_NOOP("Umbrello UML Modeller");
-
-/**
* Determines if the application GUI should be shown based on command line arguments.
* @todo Add options to use the documentation generators from command line.
*
@@ -65,13 +59,20 @@ void exportAllViews(KCmdLineArgs *args, const QStringList &exportOpt);
int main(int argc, char *argv[])
{
- KAboutData aboutData("umbrello", 0, ki18n("Umbrello UML Modeller"),
- umbrelloVersion(), ki18n(description), KAboutData::License_GPL,
- ki18n("(c) 2001 Paul Hensgen, (c) 2002-2014 Umbrello UML Modeller Authors"), KLocalizedString(),
- "http://umbrello.kde.org/");
- aboutData.addAuthor(ki18n("Paul Hensgen"), KLocalizedString(), "[email protected]");
- aboutData.addAuthor(ki18n("Umbrello UML Modeller Authors"), KLocalizedString(), "[email protected]");
- KCmdLineArgs::init(argc, argv, &aboutData);
+ QApplication app(argc, argv);
+
+ KAboutData aboutData(QStringLiteral("umbrello"),
+ i18n("Umbrello UML Modeller"),
+ QLatin1String(umbrelloVersion()),
+ i18n("Umbrello - Visual development environment for software"
+ "based on the industry standard Unified Modeling Language (UML)."),
+ KAboutLicense::GPL,
+ i18n("(c) 2001 Paul Hensgen, (c) 2002-2014 Umbrello UML Modeller Authors"),
+ QString(),
+ QStringLiteral("http://umbrello.kde.org"));
+ aboutData.addAuthor(i18n("Paul Hensgen"), QString(), QStringLiteral("[email protected]"));
+ aboutData.addAuthor(i18n("Umbrello UML Modeller Authors"), QString(), QStringLiteral("[email protected]"));
+ KAboutData::setApplicationData(aboutData);
KCmdLineOptions options;
options.add("+[File]", ki18n("File to open"));
@@ -84,7 +85,6 @@ int main(int argc, char *argv[])
// NOTE: for deprecated net.sf.umbrello dbus service name
// aboutData.setOrganizationDomain("sf.net");
- KApplication app;
if (app.isSessionRestored()) {
kRestoreMainWindows< UMLApp >();
} else {
diff --git a/umbrello/petalnode.cpp b/umbrello/petalnode.cpp
index f91c4d4..f57425b 100644
--- a/umbrello/petalnode.cpp
+++ b/umbrello/petalnode.cpp
@@ -26,7 +26,7 @@ public:
level++;
*this << className
<< "(\n"
- << QString().fill(QLatin1Char('.'), level).toAscii().constData()
+ << QString().fill(QLatin1Char('.'), level).toLatin1().constData()
;
}
@@ -34,7 +34,7 @@ public:
{
--level;
*this << "\n"
- << QString().fill(QLatin1Char(','), level).toAscii().constData()
+ << QString().fill(QLatin1Char(','), level).toLatin1().constData()
<< ")";
;
}
diff --git a/umbrello/stereotype.cpp b/umbrello/stereotype.cpp
index a92231a..b6744e7 100644
--- a/umbrello/stereotype.cpp
+++ b/umbrello/stereotype.cpp
@@ -33,8 +33,7 @@ UMLStereotype::UMLStereotype(const QString &name, Uml::ID::Type id /* = Uml::id_
m_BaseType = UMLObject::ot_Stereotype;
UMLStereotype * existing = UMLApp::app()->document()->findStereotype(name);
if (existing) {
- uError() << "UMLStereotype constructor: " << name << " already exists"
- << kBacktrace(25);
+ uError() << "UMLStereotype constructor: " << name << " already exists.";
}
m_refCount = 0;
}
diff --git a/umbrello/toolbarstate.cpp b/umbrello/toolbarstate.cpp
index 85f20c0..3c97ce3 100644
--- a/umbrello/toolbarstate.cpp
+++ b/umbrello/toolbarstate.cpp
@@ -22,7 +22,7 @@
#include "umlwidget.h"
// qt includes
-#include <QWMatrix> // need for inverseWorldMatrix.map
+#include <QMatrix> // need for inverseWorldMatrix.map
#include <QScrollBar>
/**
diff --git a/umbrello/uml.cpp b/umbrello/uml.cpp
index 1e1b06e..b17a9bf 100644
--- a/umbrello/uml.cpp
+++ b/umbrello/uml.cpp
@@ -64,7 +64,8 @@
#include <kconfig.h>
#include <kcursor.h>
#include <kfiledialog.h>
-#include <KInputDialog>
+#include <kicon.h>
+#include <kinputdialog.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kmessagebox.h>
@@ -86,7 +87,6 @@
#include <QKeyEvent>
#include <QLabel>
#include <QMenu>
-#include <QMenuItem>
#include <QPointer>
#include <QPrinter>
#include <QPrintDialog>
@@ -235,7 +235,7 @@ void UMLApp::initActions()
{
QAction* fileNew = KStandardAction::openNew(this, SLOT(slotFileNew()), actionCollection());
QAction* fileOpen = KStandardAction::open(this, SLOT(slotFileOpen()), actionCollection());
- fileOpenRecent = KStandardAction::openRecent(this, SLOT(slotFileOpenRecent(KUrl)), actionCollection());
+ fileOpenRecent = KStandardAction::openRecent(this, SLOT(slotFileOpenRecent(QUrl)), actionCollection());
QAction* fileSave = KStandardAction::save(this, SLOT(slotFileSave()), actionCollection());
QAction* fileSaveAs = KStandardAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection());
QAction* fileClose = KStandardAction::close(this, SLOT(slotFileClose()), actionCollection());
@@ -244,18 +244,14 @@ void UMLApp::initActions()
KStandardAction::findNext(this, SLOT(slotFindNext()), actionCollection());
KStandardAction::findPrev(this, SLOT(slotFindPrevious()), actionCollection());
printPreview = KStandardAction::printPreview(this, SLOT(slotPrintPreview()), actionCollection());
-#if QT_VERSION >= 0x040600
filePrint->setPriority(QAction::LowPriority); // icon only
printPreview->setPriority(QAction::LowPriority); // icon only
-#endif
QAction* fileQuit = KStandardAction::quit(this, SLOT(slotFileQuit()), actionCollection());
editUndo = m_pUndoStack->createUndoAction(actionCollection());
editRedo = m_pUndoStack->createRedoAction(actionCollection());
-#if QT_VERSION >= 0x040600
editUndo->setPriority(QAction::LowPriority); // icon only
editRedo->setPriority(QAction::LowPriority); // icon only
-#endif
disconnect(m_pUndoStack, SIGNAL(undoTextChanged(QString)), editUndo, 0);
disconnect(m_pUndoStack, SIGNAL(redoTextChanged(QString)), editRedo, 0);
@@ -540,14 +536,14 @@ void UMLApp::initActions()
QString moveTabLeftString = i18n("&Move Tab Left");
QString moveTabRightString = i18n("&Move Tab Right");
- KAction* moveTabLeft = actionCollection()->addAction(QLatin1String("move_tab_left"));
+ QAction* moveTabLeft = actionCollection()->addAction(QLatin1String("move_tab_left"));
moveTabLeft->setIcon(Icon_Utils::SmallIcon(QApplication::layoutDirection() ? Icon_Utils::it_Go_Next : Icon_Utils::it_Go_Previous));
moveTabLeft->setText(QApplication::layoutDirection() ? moveTabRightString : moveTabLeftString);
moveTabLeft->setShortcut(QApplication::layoutDirection() ?
QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Right) : QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_Left));
connect(moveTabLeft, SIGNAL(triggered(bool)), this, SLOT(slotMoveTabLeft()));
- KAction* moveTabRight = actionCollection()->addAction(QLatin1String("move_tab_right"));
+ QAction* moveTabRight = actionCollection()->addAction(QLatin1String("move_tab_right"));
moveTabRight->setIcon(Icon_Utils::SmallIcon(QApplication::layoutDirection() ? Icon_Utils::it_Go_Previous : Icon_Utils::it_Go_Next));
moveTabRight->setText(QApplication::layoutDirection() ? moveTabLeftString : moveTabRightString);
moveTabRight->setShortcut(QApplication::layoutDirection() ?
@@ -556,13 +552,13 @@ void UMLApp::initActions()
QString selectTabLeftString = i18n("Select Diagram on Left");
QString selectTabRightString = i18n("Select Diagram on Right");
- KAction* changeTabLeft = actionCollection()->addAction(QLatin1String("previous_tab"));
+ QAction* changeTabLeft = actionCollection()->addAction(QLatin1String("previous_tab"));
changeTabLeft->setText(QApplication::layoutDirection() ? selectTabRightString : selectTabLeftString);
changeTabLeft->setShortcut(QApplication::layoutDirection() ?
QKeySequence(Qt::SHIFT+Qt::Key_Right) : QKeySequence(Qt::SHIFT+Qt::Key_Left));
connect(changeTabLeft, SIGNAL(triggered(bool)), this, SLOT(slotChangeTabLeft()));
- KAction* changeTabRight = actionCollection()->addAction(QLatin1String("next_tab"));
+ QAction* changeTabRight = actionCollection()->addAction(QLatin1String("next_tab"));
changeTabRight->setText(QApplication::layoutDirection() ? selectTabLeftString : selectTabRightString);
changeTabRight->setShortcut(QApplication::layoutDirection() ?
QKeySequence(Qt::SHIFT+Qt::Key_Left) : QKeySequence(Qt::SHIFT+Qt::Key_Right));
@@ -891,7 +887,7 @@ void UMLApp::initView()
/**
* Opens a file specified by commandline option.
*/
-void UMLApp::openDocumentFile(const KUrl& url)
+void UMLApp::openDocumentFile(const QUrl& url)
{
slotStatusMsg(i18n("Opening file..."));
@@ -1087,13 +1083,13 @@ void UMLApp::saveProperties(KConfigGroup & cfg)
if (m_doc->url().fileName() != i18n("Untitled") && !m_doc->isModified()) {
// saving to tempfile not necessary
} else {
- KUrl url = m_doc->url();
+ QUrl url = m_doc->url();
cfg.writePathEntry("filename", url.url());
cfg.writeEntry("modified", m_doc->isModified());
QString tempname = kapp->tempSaveName(url.url()); //:TODO: change this - deprecated
- QString tempurl = KUrl::toPercentEncoding(tempname);
+ QString tempurl = QUrl::toPercentEncoding(tempname);
- KUrl _url(tempurl);
+ QUrl _url(tempurl);
m_doc->saveDocument(_url);
}
*/
@@ -1112,12 +1108,12 @@ void UMLApp::readProperties(const KConfigGroup & cfg) //:TODO: applyMainWind
Q_UNUSED(cfg);
/*
QString filename = cfg.readPathEntry("filename", QString());
- KUrl url(filename);
+ QUrl url(filename);
bool modified = cfg.readEntry("modified", false);
if (modified) {
bool canRecover;
QString tempname = kapp->checkRecoverFile(filename, canRecover);
- KUrl _url(tempname);
+ QUrl _url(tempname);
if (canRecover) {
m_doc->openDocument(_url);
@@ -1193,7 +1189,7 @@ void UMLApp::slotFileOpen()
// here saving wasn't successful
}
else {
- KUrl url=KFileDialog::getOpenUrl(KUrl(),
+ QUrl url = KFileDialog::getOpenUrl(QUrl(),
i18n("*.xmi *.xmi.tgz *.xmi.tar.bz2 *.mdl *.zargo|All Supported Files (*.xmi, *.xmi.tgz, *.xmi.tar.bz2, *.mdl, *.zargo)\n"
"*.xmi|Uncompressed XMI Files (*.xmi)\n"
"*.xmi.tgz|Gzip Compressed XMI Files (*.xmi.tgz)\n"
@@ -1219,12 +1215,12 @@ void UMLApp::slotFileOpen()
/**
* Opens a file from the recent files menu.
*/
-void UMLApp::slotFileOpenRecent(const KUrl& url)
+void UMLApp::slotFileOpenRecent(const QUrl& url)
{
slotStatusMsg(i18n("Opening file..."));
m_loading = true;
- KUrl oldUrl = m_doc->url();
+ QUrl oldUrl = m_doc->url();
if (!m_doc->saveModified()) {
// here saving wasn't successful
@@ -1269,16 +1265,16 @@ bool UMLApp::slotFileSaveAs()
{
slotStatusMsg(i18n("Saving file with a new filename..."));
bool cont = true;
- KUrl url;
+ QUrl url;
QString ext;
while (cont) {
- url=KFileDialog::getSaveUrl(KUrl(), i18n("*.xmi|XMI File\n*.xmi.tgz|Gzip Compressed XMI File\n*.xmi.tar.bz2|Bzip2 Compressed XMI File\n*|All Files"), this, i18n("Save As"));
+ url=KFileDialog::getSaveUrl(QUrl(), i18n("*.xmi|XMI File\n*.xmi.tgz|Gzip Compressed XMI File\n*.xmi.tar.bz2|Bzip2 Compressed XMI File\n*|All Files"), this, i18n("Save As"));
if (url.isEmpty()) {
cont = false;
}
else {
// now check that we have a file extension; standard will be plain xmi
- //QString file = url.path(KUrl::RemoveTrailingSlash);
+ //QString file = url.path(QUrl::RemoveTrailingSlash);
//QFileInfo info(file);
//ext = info.completeSuffix();
//if (ext != "xmi" && ext != "xmi.tgz" && ext != "xmi.tar.bz2")
@@ -1287,7 +1283,7 @@ bool UMLApp::slotFileSaveAs()
// ext = "xmi";
//}
if (url.isLocalFile()) {
- QString file = url.toLocalFile(KUrl::RemoveTrailingSlash);
+ QString file = url.toLocalFile();
if (QFile::exists(file)) {
int want_save = KMessageBox::warningContinueCancel(this, i18n("The file %1 exists.\nDo you wish to overwrite it?", url.toLocalFile()),
@@ -1830,7 +1826,7 @@ bool UMLApp::canDecode(const QMimeData* mimeData)
{
QStringList supportedFormats = mimeData->formats();
foreach(const QString &format, supportedFormats) {
- QByteArray fba = format.toAscii();
+ QByteArray fba = format.toLatin1();
const char* f = fba.constData();
if (!qstrnicmp(f,"application/x-uml-clip", 22)) {
//FIXME need to test for clip1, clip2, clip3, clip4 or clip5
@@ -2630,7 +2626,7 @@ void UMLApp::slotImportClass()
QString f = filters.join(QLatin1String(" ")) + QLatin1String("|") +
Uml::ProgrammingLanguage::toExtensionsDescription(UMLApp::app()->activeLanguage());
- QStringList files = KFileDialog::getOpenFileNames(KUrl(), f, this, i18n("Select file(s) to import:"));
+ QStringList files = KFileDialog::getOpenFileNames(QUrl(), f, this, i18n("Select file(s) to import:"));
if (!files.isEmpty()) {
importFiles(&files);
}
@@ -2659,7 +2655,7 @@ void getFiles(QStringList& files, const QString& path, QStringList& filters)
void UMLApp::slotImportProject()
{
QStringList listFile;
- QString dir = KFileDialog::getExistingDirectory(KUrl(),this, i18n("Select directory to import:"));
+ QString dir = KFileDialog::getExistingDirectory(QUrl(),this, i18n("Select directory to import:"));
if (!dir.isEmpty()) {
QStringList filter = Uml::ProgrammingLanguage::toExtensions(UMLApp::app()->activeLanguage());
getFiles(listFile, dir, filter);
diff --git a/umbrello/uml.h b/umbrello/uml.h
index 571eec9..f21747e 100644
--- a/umbrello/uml.h
+++ b/umbrello/uml.h
@@ -14,9 +14,10 @@
#include "basictypes.h"
#include <kxmlguiwindow.h>
-#include <kurl.h>
#include <ksharedconfig.h>
+#include <QUrl>
+
// forward declaration of the UML classes
class CodeDocument;
class CodeGenerator;
@@ -89,7 +90,7 @@ public:
static UMLApp* app();
- void openDocumentFile(const KUrl& url=KUrl());
+ void openDocumentFile(const QUrl& url=QUrl());
void newDocument();
@@ -201,7 +202,7 @@ public slots:
void slotFileNew();
void slotFileOpen();
- void slotFileOpenRecent(const KUrl& url);
+ void slotFileOpenRecent(const QUrl& url);
void slotFileSave();
bool slotFileSaveAs();
void slotFileClose();
@@ -396,8 +397,8 @@ private:
QAction* zoom100Action;
QAction* m_langAct[Uml::ProgrammingLanguage::Reserved];
- KAction* deleteSelectedWidget;
- KAction* deleteDiagram;
+ QAction* deleteSelectedWidget;
+ QAction* deleteDiagram;
QToolButton* m_newSessionButton;
KMenu* m_diagramMenu;
diff --git a/umbrello/umlappprivate.h b/umbrello/umlappprivate.h
index 723e5eb..aed5373 100644
--- a/umbrello/umlappprivate.h
+++ b/umbrello/umlappprivate.h
@@ -17,10 +17,11 @@
#include "uml.h"
// kde includes
+#include <kdialog.h>
+#include <kglobal.h>
#include <ktexteditor/configinterface.h>
#include <ktexteditor/document.h>
#include <ktexteditor/editor.h>
-#include <ktexteditor/editorchooser.h>
#include <ktexteditor/view.h>
// qt includes
@@ -56,7 +57,7 @@ public:
view(0),
document(0)
{
- editor = KTextEditor::EditorChooser::editor();
+ editor = KTextEditor::Editor::instance();
logWindow = new QListWidget;
connect(logWindow, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(slotLogWindowItemDoubleClicked(QListWidgetItem *)));
}
@@ -72,7 +73,7 @@ public slots:
document = editor->createDocument(0);
view = document->createView(parent);
- view->document()->openUrl(columns[0]);
+ view->document()->openUrl(QUrl(columns[0]));
view->document()->setReadWrite(false);
view->setCursorPosition(KTextEditor::Cursor(columns[1].toInt()-1,columns[2].toInt()));
KTextEditor::ConfigInterface *iface = qobject_cast<KTextEditor::ConfigInterface*>(view);
diff --git a/umbrello/umldoc.cpp b/umbrello/umldoc.cpp
index 4fafb18..6f5307f 100644
--- a/umbrello/umldoc.cpp
+++ b/umbrello/umldoc.cpp
@@ -712,9 +712,9 @@ bool UMLDoc::saveDocument(const KUrl& url, const char * format)
// now remove the original file
#ifdef Q_WS_WIN
tmpfile.setAutoRemove(true);
- KIO::FileCopyJob* fcj = KIO::file_copy(tmpfile.fileName(), url, -1, KIO::Overwrite);
+ KIO::FileCopyJob* fcj = KIO::file_copy(QUrl::fromLocalFile(tmpfile.fileName()), url, -1, KIO::Overwrite);
#else
- KIO::FileCopyJob* fcj = KIO::file_move(tmpfile.fileName(), url, -1, KIO::Overwrite);
+ KIO::FileCopyJob* fcj = KIO::file_move(QUrl::fromLocalFile(tmpfile.fileName()), url, -1, KIO::Overwrite);
#endif
if (KIO::NetAccess::synchronousRun(fcj, (QWidget*)UMLApp::app()) == false) {
KMessageBox::error(0, i18n("There was a problem saving file: %1", url.pathOrUrl()), i18n("Save Error"));
diff --git a/umbrello/umllistview.cpp b/umbrello/umllistview.cpp
index 0f027f4..c0c1752 100644
--- a/umbrello/umllistview.cpp
+++ b/umbrello/umllistview.cpp
@@ -68,6 +68,7 @@
#include <ktabwidget.h>
// qt includes
+#include <QDrag>
#include <QDropEvent>
#include <QEvent>
#include <QFocusEvent>
@@ -481,8 +482,10 @@ void UMLListView::slotMenuSelection(QAction* action, const QPoint &position)
}
// configure & show the file dialog
const QString rootDir(m_doc->url().directory());
- QPointer<KFileDialog> fileDialog = new KFileDialog(rootDir, QLatin1String("*.xml"), this);
+ QPointer<KFileDialog> fileDialog = new KFileDialog(QUrl(rootDir), QLatin1String("*.xml"), this);
+#if 0 //FIXME KF5
fileDialog->setCaption(i18n("Externalize Folder"));
+#endif
fileDialog->setOperationMode(KFileDialog::Other);
// set a sensible default filename
QString defaultFilename = current->text(0).toLower();
diff --git a/umbrello/umlviewimageexporterall.cpp b/umbrello/umlviewimageexporterall.cpp
index 3431afc..50ccd4f 100644
--- a/umbrello/umlviewimageexporterall.cpp
+++ b/umbrello/umlviewimageexporterall.cpp
@@ -64,7 +64,7 @@ void UMLViewImageExporterAll::exportAllViews()
// default url can't be set when creating the action because the
// document wasn't loaded
if (m_dialog->m_kURL->url().isEmpty()) {
- m_dialog->m_kURL->setUrl(umlDoc->url().directory());
+ m_dialog->m_kURL->setUrl(QUrl(umlDoc->url().directory()));
}
if (m_dialog->exec() == QDialog::Rejected) {
diff --git a/umbrello/umlviewimageexportermodel.cpp b/umbrello/umlviewimageexportermodel.cpp
index 09d2fd2..778ba06 100644
--- a/umbrello/umlviewimageexportermodel.cpp
+++ b/umbrello/umlviewimageexportermodel.cpp
@@ -197,7 +197,7 @@ UMLViewImageExporterModel::~UMLViewImageExporterModel()
* @return A QStringList with all the error messages that occurred during export.
* If the list is empty, all the views were exported successfully.
*/
-QStringList UMLViewImageExporterModel::exportAllViews(const QString &imageType, const KUrl &directory, bool useFolders) const
+QStringList UMLViewImageExporterModel::exportAllViews(const QString &imageType, const QUrl &directory, bool useFolders) const
{
UMLApp *app = UMLApp::app();
@@ -206,12 +206,11 @@ QStringList UMLViewImageExporterModel::exportAllViews(const QString &imageType,
UMLViewList views = app->document()->viewIterator();
foreach (UMLView *view, views) {
- KUrl url = directory;
- url.addPath(getDiagramFileName(view->umlScene(), imageType, useFolders));
+ QUrl url(directory.path() + QLatin1Char('/') +
+ getDiagramFileName(view->umlScene(), imageType, useFolders));
QString returnString = exportView(view->umlScene(), imageType, url);
if (!returnString.isNull()) {
- // [PORT]
errors.append(view->umlScene()->name() + QLatin1String(": ") + returnString);
}
}
@@ -234,7 +233,7 @@ QStringList UMLViewImageExporterModel::exportAllViews(const QString &imageType,
* @return The error message if some problem occurred when exporting, or
* QString() if all went fine.
*/
-QString UMLViewImageExporterModel::exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const
+QString UMLViewImageExporterModel::exportView(UMLScene* scene, const QString &imageType, const QUrl &url) const
{
if (!scene) {
return i18n("Empty scene");
@@ -242,7 +241,7 @@ QString UMLViewImageExporterModel::exportView(UMLScene* scene, const QString &im
// create the needed directories
if (!prepareDirectory(url)) {
- return i18n("Cannot create directory: %1", url.directory());
+ return i18n("Cannot create directory: %1", url.path());
}
// The fileName will be used when exporting the image. If the url isn't local,
@@ -309,16 +308,16 @@ QString UMLViewImageExporterModel::getDiagramFileName(UMLScene* scene, const QSt
* @return True if the operation was successful,
* false if the directory didn't exist and couldn't be created.
*/
-bool UMLViewImageExporterModel::prepareDirectory(const KUrl &url) const
+bool UMLViewImageExporterModel::prepareDirectory(const QUrl &url) const
{
- // the KUrl is copied to get protocol, user and so on and then the path is cleaned
- KUrl directory = url;
+ // the QUrl is copied to get protocol, user and so on and then the path is cleaned
+ QUrl directory = url;
directory.setPath(QString());
// creates the directory and any needed parent directories
- QStringList dirs = url.directory().split(QDir::separator(), QString::SkipEmptyParts);
+ QStringList dirs = url.path().split(QDir::separator(), QString::SkipEmptyParts);
for (QStringList::ConstIterator it = dirs.constBegin() ; it != dirs.constEnd(); ++it) {
- directory.addPath(*it);
+ directory.setPath(directory.path() + QLatin1Char('/') + *it);
if (!KIO::NetAccess::exists(directory, KIO::NetAccess::SourceSide, UMLApp::app())) {
@@ -428,7 +427,9 @@ bool UMLViewImageExporterModel::exportViewToEps(UMLScene* scene, const QString &
printer = new QPrinter(QPrinter::ScreenResolution);
}
printer->setOutputFileName(fileName);
+#if 0 //FIXME KF5
printer->setOutputFormat(QPrinter::PostScriptFormat);
+#endif
printer->setColorMode(QPrinter::Color);
// do not call printer.setup(); because we want no user
diff --git a/umbrello/umlviewimageexportermodel.h b/umbrello/umlviewimageexportermodel.h
index c08c8e6..b900872 100644
--- a/umbrello/umlviewimageexportermodel.h
+++ b/umbrello/umlviewimageexportermodel.h
@@ -17,7 +17,7 @@
#include <QRect>
// forward declarations
-class KUrl;
+class QUrl;
/**
* Exports an UMLView in various image formats.
@@ -42,14 +42,14 @@ public:
UMLViewImageExporterModel();
virtual ~UMLViewImageExporterModel();
- QStringList exportAllViews(const QString &imageType, const KUrl &directory, bool useFolders) const;
- QString exportView(UMLScene* scene, const QString &imageType, const KUrl &url) const;
+ QStringList exportAllViews(const QString &imageType, const QUrl &directory, bool useFolders) const;
+ QString exportView(UMLScene* scene, const QString &imageType, const QUrl &url) const;
private:
QString getDiagramFileName(UMLScene* scene, const QString &imageType, bool useFolders = false) const;
- bool prepareDirectory(const KUrl &url) const;
+ bool prepareDirectory(const QUrl &url) const;
bool exportViewTo(UMLScene* scene, const QString &imageType, const QString &fileName) const;
bool exportViewToDot(UMLScene* scene, const QString &fileName) const;
diff --git a/umbrello/widgets/associationline.cpp b/umbrello/widgets/associationline.cpp
index 7e8c523..69834dc 100644
--- a/umbrello/widgets/associationline.cpp
+++ b/umbrello/widgets/associationline.cpp
@@ -1352,7 +1352,7 @@ void Symbol::alignTo(const QLineF& to)
QLineF translatedAxis = origAxis.translated(toMapped.p2() - origAxis.p2());
qreal angle = translatedAxis.angleTo(toMapped);
- rotate(-angle);
+ setRotation(rotation() - angle);
QPointF delta = to.p2() - mapToParent(symbolEndPoints().second);
moveBy(delta.x(), delta.y());
diff --git a/umbrello/widgets/statusbartoolbutton.cpp b/umbrello/widgets/statusbartoolbutton.cpp
index c790acc..b2f6362 100644
--- a/umbrello/widgets/statusbartoolbutton.cpp
+++ b/umbrello/widgets/statusbartoolbutton.cpp
@@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "statusbartoolbutton.h"
+
// Qt
#include <QAction>
#include <QStyleOptionToolButton>
diff --git a/umbrello/worktoolbar.cpp b/umbrello/worktoolbar.cpp
index ef9718e..37aa16a 100644
--- a/umbrello/worktoolbar.cpp
+++ b/umbrello/worktoolbar.cpp
@@ -19,9 +19,10 @@
#include "umlview.h"
// kde include files
+#include <kicon.h>
#include <klocale.h>
-#include <KAction>
-#include <KActionCollection>
+#include <kaction.h>
+#include <kactioncollection.h>
// qt include files
#include <QToolButton>
@@ -65,7 +66,7 @@ WorkToolBar::~WorkToolBar()
*/
QAction* WorkToolBar::insertHotBtn(ToolBar_Buttons tbb)
{
- KAction *action = m_actions[tbb];
+ QAction *action = m_actions[tbb];
addAction(action);
action->setChecked(true);
return action;
@@ -377,7 +378,7 @@ void WorkToolBar::loadPixmaps()
for (uint i = 0; i < n_buttonInfos; ++i) {
const ButtonInfo& info = buttonInfo[i];
QString key = QLatin1String(ENUM_NAME(WorkToolBar, ToolBar_Buttons, info.tbb));
- KAction *action = collection->addAction(key, this, info.slotName);
+ QAction *action = collection->addAction(key, this, info.slotName);
action->setIcon(KIcon(Icon_Utils::BarIcon(info.icon)));
action->setText(info.btnName);
m_actions[info.tbb] = action;
diff --git a/umbrello/worktoolbar.h b/umbrello/worktoolbar.h
index 641b690..9646144 100644
--- a/umbrello/worktoolbar.h
+++ b/umbrello/worktoolbar.h
@@ -20,7 +20,7 @@
#include <QPixmap>
class QMainWindow;
-class KAction;
+class QAction;
/**
* This is the toolbar that is displayed on the right-hand side of the program
@@ -124,7 +124,7 @@ private:
typedef QMap<Uml::DiagramType::Enum, ToolBar_Buttons> OldToolMap;
typedef QMap<ToolBar_Buttons, QCursor> CursorMap;
- typedef QMap<ToolBar_Buttons, KAction*> ActionsMap;
+ typedef QMap<ToolBar_Buttons, QAction*> ActionsMap;
ToolBar_Buttons m_CurrentButtonID;
OldToolMap m_map;