[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Sun Jan 1 14:30:38 UTC 2012
SVN commit 1271011 by fischer:
Constructor improved. Member variables renamed. Krazy2 issue fixed.
M +40 -40 uml.cpp
M +3 -4 uml.h
M +3 -4 umlviewimageexporterall.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #1271010:1271011
@@ -118,30 +118,35 @@
/**
* Constructor. Calls all init functions to create the application.
*/
-UMLApp::UMLApp(QWidget* parent) : KXmlGuiWindow(parent)
+UMLApp::UMLApp(QWidget* parent)
+ : KXmlGuiWindow(parent),
+ m_langSelect(0),
+ m_zoomSelect(0),
+ m_activeLanguage(Uml::ProgrammingLanguage::Reserved),
+ m_codegen(0),
+ m_commoncodegenpolicy(new CodeGenerationPolicy()),
+ m_policyext(0),
+ m_config(KGlobal::config()),
+ m_view(0),
+ m_doc(new UMLDoc()),
+ m_listView(0),
+ m_pDocWindow(0),
+ m_refactoringAssist(0),
+ m_clipTimer(0),
+ m_copyTimer(0),
+ m_loading(false),
+ m_imageMimeType(QString()),
+ m_settingsDlg(0),
+ m_imageExporterAll(new UMLViewImageExporterAll()),
+ m_xhtmlGenerator(0),
+ m_pUndoStack(new KUndoStack(this)),
+ m_hasBegunMacro(false),
+ m_printSettings(0),
+ m_printer(new QPrinter())
{
s_instance = this;
- m_pDocWindow = 0;
- m_config = KGlobal::config();
- m_listView = 0;
- m_langSelect = 0;
- m_zoomSelect = 0;
- m_loading = false;
- m_clipTimer = 0;
- m_copyTimer = 0;
- m_codegen = 0;
- m_policyext = 0;
- m_commoncodegenpolicy = 0;
- m_xhtmlGenerator = 0;
- m_activeLanguage = Uml::ProgrammingLanguage::Reserved;
- m_pUndoStack = new KUndoStack(this);
- m_doc = new UMLDoc();
m_doc->init();
- m_hasBegunMacro = false;
- m_printSettings = 0;
- m_printer = new QPrinter;
m_printer->setFullPage(true);
- m_dlg = NULL;
readOptionState();
initActions();
@@ -159,7 +164,6 @@
//get a reference to the Code->Active Language and to the Diagram->Zoom menu
m_langSelect = findMenu(QString("active_lang_menu") );
-
//in case langSelect hasn't been initialized we create the Popup menu.
//it will be hidden, but at least we wont crash if someone takes the entry away from the ui.rc file
if (m_langSelect == NULL) {
@@ -167,7 +171,6 @@
}
m_zoomSelect = findMenu(QString("zoom_menu") );
-
//in case zoomSelect hasn't been initialized we create the Popup menu.
//it will be hidden, but at least we wont crash if some one takes the entry away from the ui.rc file
if (m_zoomSelect == NULL) {
@@ -178,10 +181,6 @@
connect(m_zoomSelect,SIGNAL(aboutToShow()),this,SLOT(setupZoomMenu()));
connect(m_zoomSelect,SIGNAL(triggered(QAction*)),this,SLOT(slotSetZoom(QAction*)));
- m_refactoringAssist = NULL;
- m_commoncodegenpolicy = new CodeGenerationPolicy();
- m_imageExporterAll = new UMLViewImageExporterAll();
-
setAutoSaveSettings();
m_toolsbar->setToolButtonStyle(Qt::ToolButtonIconOnly); // too many items for text, really we want a toolbox widget
}
@@ -739,7 +738,7 @@
void UMLApp::initView()
{
setCaption(m_doc->url().fileName(),false);
- m_view = NULL;
+ m_view = 0;
m_toolsbar = new WorkToolBar(this);
m_toolsbar->setWindowTitle(i18n("Diagram Toolbar"));
addToolBar(Qt::TopToolBarArea, m_toolsbar);
@@ -1272,16 +1271,16 @@
}
m_printSettings = new DiagramPrintPage(0, m_doc);
- KDialog *d = new KDialog();
- d->setMainWidget(m_printSettings);
+ QPointer<KDialog> dlg = new KDialog();
+ dlg->setMainWidget(m_printSettings);
- bool result = d->exec() == QDialog::Accepted;
+ bool result = dlg->exec() == QDialog::Accepted;
// keep settings
- d->setMainWidget(0);
+ dlg->setMainWidget(0);
m_printSettings->setParent(0);
- delete d;
+ delete dlg;
return result;
}
@@ -1298,6 +1297,7 @@
QPointer<QPrintPreviewDialog> preview = new QPrintPreviewDialog(m_printer,this);
connect(preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter*)));
preview->exec();
+ delete preview;
delete m_printSettings;
m_printSettings = 0;
resetStatusMsg();
@@ -1755,15 +1755,15 @@
{
Settings::OptionState& optionState = Settings::optionState();
- m_dlg = new SettingsDlg(this, &optionState);
- connect(m_dlg, SIGNAL(applyClicked()), this, SLOT(slotApplyPrefs()));
+ m_settingsDlg = new SettingsDlg(this, &optionState);
+ connect(m_settingsDlg, SIGNAL(applyClicked()), this, SLOT(slotApplyPrefs()));
- if ( m_dlg->exec() == QDialog::Accepted && m_dlg->getChangesApplied() ) {
+ if ( m_settingsDlg->exec() == QDialog::Accepted && m_settingsDlg->getChangesApplied() ) {
slotApplyPrefs();
}
- delete m_dlg;
- m_dlg = NULL;
+ delete m_settingsDlg;
+ m_settingsDlg = 0;
}
/**
@@ -1771,7 +1771,7 @@
*/
void UMLApp::slotApplyPrefs()
{
- if (m_dlg) {
+ if (m_settingsDlg) {
// we need this to sync both values
Settings::OptionState& optionState = Settings::optionState();
bool stackBrowsing = (m_layout->indexOf(m_tabWidget) != -1);
@@ -1814,7 +1814,7 @@
}
m_doc->settingsChanged( optionState );
- const QString plStr = m_dlg->getCodeGenerationLanguage();
+ const QString plStr = m_settingsDlg->getCodeGenerationLanguage();
Uml::ProgrammingLanguage pl = Uml::ProgrammingLanguage::fromString(plStr);
setGenerator(pl);
}
@@ -2732,7 +2732,7 @@
* Sets the default mime type for all diagrams that are exported as images.
* @param mimeType the mime type
*/
-void UMLApp::setImageMimeType(QString const & mimeType)
+void UMLApp::setImageMimeType(const QString& mimeType)
{
m_imageMimeType = mimeType;
}
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.h #1271010:1271011
@@ -128,7 +128,7 @@
void setCurrentView(UMLView* view);
UMLView* currentView() const;
- void setImageMimeType(QString const & mimeType);
+ void setImageMimeType(const QString& mimeType);
QString imageMimeType() const;
bool editCutCopy(bool bFromView);
@@ -183,8 +183,6 @@
virtual void saveProperties(KConfigGroup & cfg);
virtual void readProperties(const KConfigGroup & cfg);
- CodeGenerationPolicy * m_commoncodegenpolicy;
-
void updateLangSelectMenu(Uml::ProgrammingLanguage activeLanguage);
public slots:
@@ -315,6 +313,7 @@
Uml::ProgrammingLanguage m_activeLanguage; ///< Active language.
CodeGenerator* m_codegen; ///< Active code generator.
+ CodeGenerationPolicy* m_commoncodegenpolicy;
CodeGenPolicyExt* m_policyext; ///< Active policy extension.
// Only used for new code generators ({Cpp,Java,Ruby,D}CodeGenerator).
@@ -400,7 +399,7 @@
QString m_imageMimeType; ///< Default mime type to use for image export.
- SettingsDlg* m_dlg; ///< The global UML settings dialog.
+ SettingsDlg* m_settingsDlg; ///< The global UML settings dialog.
UMLViewImageExporterAll* m_imageExporterAll; ///< Used to export all the views.
--- trunk/KDE/kdesdk/umbrello/umbrello/umlviewimageexporterall.cpp #1271010:1271011
@@ -4,7 +4,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * copyright (C) 2006-2010 *
+ * copyright (C) 2006-2011 *
* Umbrello UML Modeller Authors <uml-devel at uml.sf.net> *
***************************************************************************/
@@ -12,7 +12,7 @@
#include "umlviewimageexporterall.h"
// application specific includes
-#include "dialogs/exportallviewsdialog.h"
+#include "exportallviewsdialog.h"
#include "umlviewimageexportermodel.h"
#include "uml.h"
#include "umldoc.h"
@@ -33,7 +33,7 @@
*/
UMLViewImageExporterAll::UMLViewImageExporterAll()
{
- m_dialog = new ExportAllViewsDialog(0, "exportAllViewsDialog", false, 0, UMLApp::app()->imageMimeType());
+ m_dialog = new ExportAllViewsDialog(0, "exportAllViewsDialog");
}
/**
@@ -83,4 +83,3 @@
}
umlDoc->writeToStatusBar(i18nc("reset status bar", "Ready."));
}
-
More information about the umbrello-devel
mailing list