diff --git a/ext/qcodeedit/lib/qpanellayout.cpp b/ext/qcodeedit/lib/qpanellayout.cpp index b10459b4..4ed4dff0 100644 --- a/ext/qcodeedit/lib/qpanellayout.cpp +++ b/ext/qcodeedit/lib/qpanellayout.cpp @@ -260,7 +260,7 @@ QLayoutItem* QPanelLayout::takeAt(int idx) { if ( (idx >= 0) && (idx < m_list.size()) ) { - PanelWrapper *layoutStruct = m_list.takeAt(idx); + QScopedPointer layoutStruct(m_list.takeAt(idx)); return layoutStruct->item; } diff --git a/framework/codecompletion/pool.cpp b/framework/codecompletion/pool.cpp index 357e8f69..ae4a7d0e 100644 --- a/framework/codecompletion/pool.cpp +++ b/framework/codecompletion/pool.cpp @@ -55,7 +55,8 @@ Pool::Pool() : d(new PrivatePool) Pool::~Pool() { - + qDeleteAll(d->_factories.values()); + qDeleteAll(d->_parsers.values()); } void Pool::updateParsers() diff --git a/framework/core/errordockimpl.cpp b/framework/core/errordockimpl.cpp index 21dfd3e7..399f25fd 100644 --- a/framework/core/errordockimpl.cpp +++ b/framework/core/errordockimpl.cpp @@ -32,12 +32,11 @@ /* ErrorDockWidgetImpl */ -ErrorDockWidgetImpl::ErrorDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent) +ErrorDockWidgetImpl::ErrorDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent), _widget(new Ui::ErrorDockWidget) { setWindowTitle(tr("Warnings/Errors")); setWindowIcon(QIcon(":/images/warning.png")); - _widget = new Ui::ErrorDockWidget(); _widget->setupUi(this); QAction * clearAction = new QAction(tr("Clear the errors"), this); diff --git a/framework/core/errordockimpl.h b/framework/core/errordockimpl.h index 115facef..0755e68c 100644 --- a/framework/core/errordockimpl.h +++ b/framework/core/errordockimpl.h @@ -43,7 +43,7 @@ public slots: protected slots: void doubleClicked(const QModelIndex & index);; private: - Ui::ErrorDockWidget * _widget; + QScopedPointer _widget; }; #endif /* ERRORDOCKWIDGETIMPL_H */ diff --git a/framework/core/filewatcher.cpp b/framework/core/filewatcher.cpp index 1b153de7..ad0096ea 100644 --- a/framework/core/filewatcher.cpp +++ b/framework/core/filewatcher.cpp @@ -219,19 +219,18 @@ void PrivateFilesWatcher::removePaths(const QStringList & paths) * Create a FileWatcher with a file name * \param filename The file name to watch. */ -FileWatcher::FileWatcher(const QString & filename) +FileWatcher::FileWatcher(const QString & filename) : d(new PrivateFileWatcher(this)) { - d = new PrivateFileWatcher(this); d->m_filename = filename; - connect(FileWatcherManager::instance(), SIGNAL(fileChanged(QString)), d, SLOT(fileChanged(QString)), Qt::QueuedConnection); + connect(FileWatcherManager::instance(), SIGNAL(fileChanged(QString)), d.data(), SLOT(fileChanged(QString)), Qt::QueuedConnection); FileWatcherManager::instance()->addFile(filename); } /*! Destroy the FileWatcher */ FileWatcher::~FileWatcher() { - delete d; + } /*! @@ -274,17 +273,15 @@ void FileWatcher::activate() /*! * Create a FilesWatcher with a file name */ -FilesWatcher::FilesWatcher(QObject* parent) : QObject(parent) +FilesWatcher::FilesWatcher(QObject* parent) : QObject(parent), d(new PrivateFilesWatcher(this)) { - d = new PrivateFilesWatcher(this); - - connect(FileWatcherManager::instance(), SIGNAL(fileChanged(QString)), d, SLOT(fileChanged(QString)), Qt::QueuedConnection); + connect(FileWatcherManager::instance(), SIGNAL(fileChanged(QString)), d.data(), SLOT(fileChanged(QString)), Qt::QueuedConnection); } /*! Destroy the FilesWatcher */ FilesWatcher::~FilesWatcher() { - delete d; + } void FilesWatcher::addPath(const QString& path) diff --git a/framework/core/filewatcher.h b/framework/core/filewatcher.h index ba5d338e..bcb7de3b 100644 --- a/framework/core/filewatcher.h +++ b/framework/core/filewatcher.h @@ -42,7 +42,7 @@ public: signals: void fileChanged(); protected: - PrivateFileWatcher * d; + QScopedPointer d; friend class PrivateFileWatcher; }; @@ -60,7 +60,7 @@ public: signals: void fileChanged(const QString & path); private: - PrivateFilesWatcher * d; + QScopedPointer d; friend class PrivateFilesWatcher; }; diff --git a/framework/editors/textfileeditor.cpp b/framework/editors/textfileeditor.cpp index 864195f2..854f3d24 100644 --- a/framework/editors/textfileeditor.cpp +++ b/framework/editors/textfileeditor.cpp @@ -139,15 +139,15 @@ TextFileEditor::~TextFileEditor() void TextFileEditor::initObjects() { - _modification_timer = new QTimer(); + _modification_timer.reset(new QTimer); _modification_timer->setSingleShot(true); _modification_timer->setInterval(XINXConfig::self()->config().editor.automaticModelRefreshTimeout); - connect(_modification_timer, SIGNAL(timeout()), this, SLOT(updateModel())); + connect(_modification_timer.data(), SIGNAL(timeout()), this, SLOT(updateModel())); - _move_timer = new QTimer(); + _move_timer.reset(new QTimer); _move_timer->setSingleShot(true); _move_timer->setInterval(100); - connect(_move_timer, SIGNAL(timeout()), this, SLOT(updateContext())); + connect(_move_timer.data(), SIGNAL(timeout()), this, SLOT(updateContext())); // Set the internal editor used by textfileeditor if (! m_view) diff --git a/framework/editors/textfileeditor.h b/framework/editors/textfileeditor.h index 205d8d75..9ee97a6a 100644 --- a/framework/editors/textfileeditor.h +++ b/framework/editors/textfileeditor.h @@ -154,7 +154,7 @@ private slots: private: void initObjects(); - QTimer * _modification_timer, * _move_timer; + QScopedPointer _modification_timer, _move_timer; QString m_codec; XinxCodeEdit * m_view; diff --git a/framework/editors/xinxcodeedit.cpp b/framework/editors/xinxcodeedit.cpp index 757bd587..ed774886 100644 --- a/framework/editors/xinxcodeedit.cpp +++ b/framework/editors/xinxcodeedit.cpp @@ -165,6 +165,7 @@ void XinxCodeEdit::init(bool action) //! Destroy the object XinxCodeEdit::~XinxCodeEdit() { + delete m_matchingText; m_editor->editor()->setInputBinding(0); m_editor->editor()->removeInputBinding(this); delete m_editor; diff --git a/framework/plugins/xinxpluginsloader.cpp b/framework/plugins/xinxpluginsloader.cpp index 8d4a6c3e..27c15eda 100644 --- a/framework/plugins/xinxpluginsloader.cpp +++ b/framework/plugins/xinxpluginsloader.cpp @@ -397,7 +397,9 @@ void XinxPluginsLoader::addPlugin(QObject * plugin, bool staticLoaded) void XinxPluginsLoader::loadPlugins() { foreach(QObject * plugin, QPluginLoader::staticInstances()) - addPlugin(plugin, true); + { + addPlugin(plugin, true); + } foreach(const QString & directory, QDir::searchPaths("plugins")) { diff --git a/framework/search/searchdockimpl.cpp b/framework/search/searchdockimpl.cpp index 32c68ae5..87f85bab 100644 --- a/framework/search/searchdockimpl.cpp +++ b/framework/search/searchdockimpl.cpp @@ -80,12 +80,11 @@ void SearchLogWidgetDelegate::paint(QPainter * painter, const QStyleOptionViewIt /* SearchDockWidgetImpl */ -SearchDockWidgetImpl::SearchDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent) +SearchDockWidgetImpl::SearchDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent), _widget(new Ui::SearchDockWidget) { setWindowTitle(tr("Search Result")); setWindowIcon(QIcon(":/images/find.png")); - _widget = new Ui::SearchDockWidget(); _widget->setupUi(this); _widget->m_searchTreeWidget->setItemDelegate(new SearchLogWidgetDelegate); diff --git a/framework/search/searchdockimpl.h b/framework/search/searchdockimpl.h index 7ecde643..ea7af30b 100644 --- a/framework/search/searchdockimpl.h +++ b/framework/search/searchdockimpl.h @@ -47,7 +47,7 @@ public slots: protected slots: void doubleClicked(const QModelIndex & index);; private: - Ui::SearchDockWidget * _widget; + QScopedPointer _widget; }; #endif /* SEARCHDOCKIMPL_H */ diff --git a/framework/session/sessionmanager.cpp b/framework/session/sessionmanager.cpp index 2fbb7c35..07a48652 100644 --- a/framework/session/sessionmanager.cpp +++ b/framework/session/sessionmanager.cpp @@ -21,6 +21,7 @@ #include "sessionmanager_p.h" #include "session.h" #include +#include #include #include #include @@ -226,7 +227,14 @@ void SessionManager::restoreSession(const QString & sessionName) const QString currentProjectPath = d->_current_session->currentProjectPath(); foreach(const QString & projectPath, d->_current_session->openedProject()) { - XinxProject::Manager::self()->openProject(projectPath); + try + { + XinxProject::Manager::self()->openProject(projectPath); + } + catch (XinxProject::ProjectException e) + { + qWarning() << e.getMessage() << " : " << projectPath; + } } if (! currentProjectPath.isEmpty()) diff --git a/framework/versioncontrol/rcslogdockimpl.cpp b/framework/versioncontrol/rcslogdockimpl.cpp index 56e9f816..aaefdcb2 100644 --- a/framework/versioncontrol/rcslogdockimpl.cpp +++ b/framework/versioncontrol/rcslogdockimpl.cpp @@ -30,12 +30,11 @@ /* RCSLogDockWidgetImpl */ -RCSLogDockWidgetImpl::RCSLogDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent) +RCSLogDockWidgetImpl::RCSLogDockWidgetImpl(QWidget * parent) : AbstractMessageDockWidget(parent), _widget(new Ui::RCSDockWidget) { setWindowTitle(tr("Version Control Logs")); setWindowIcon(QIcon(":/images/ecmascript.png")); - _widget = new Ui::RCSDockWidget(); _widget->setupUi(this); _widget->m_progressBar->hide(); diff --git a/framework/versioncontrol/rcslogdockimpl.h b/framework/versioncontrol/rcslogdockimpl.h index 68fbe3cb..32863f0a 100644 --- a/framework/versioncontrol/rcslogdockimpl.h +++ b/framework/versioncontrol/rcslogdockimpl.h @@ -49,7 +49,7 @@ public: private slots: void timeout(); private: - Ui::RCSDockWidget * _widget; + QScopedPointer _widget; bool _rcsVisible; QTimer * _timer; }; diff --git a/plugins/core/plugindefinition/coreplugin.cpp b/plugins/core/plugindefinition/coreplugin.cpp index 2af688e2..28abd150 100644 --- a/plugins/core/plugindefinition/coreplugin.cpp +++ b/plugins/core/plugindefinition/coreplugin.cpp @@ -79,6 +79,7 @@ CorePlugin::CorePlugin() : m_dock(0) CorePlugin::~CorePlugin() { + qDebug() << "Destroy plugin CorePlugin"; qDeleteAll(m_fileTypes); delete SelfWebPluginSettings::self(); } diff --git a/plugins/cvsplugin/pluginsettings.cpp b/plugins/cvsplugin/pluginsettings.cpp index a3744a53..68ba31a0 100644 --- a/plugins/cvsplugin/pluginsettings.cpp +++ b/plugins/cvsplugin/pluginsettings.cpp @@ -58,20 +58,19 @@ void PrivatePluginSettings::deleteSettings() /* PluginSettings */ -PluginSettings::PluginSettings(const PluginSettings & origine) +PluginSettings::PluginSettings(const PluginSettings & origine) : d(new PrivatePluginSettings(this)) { - d = new PrivatePluginSettings(this); d->m_globals = origine.d->m_globals; } -PluginSettings::PluginSettings() +PluginSettings::PluginSettings() : d(new PrivatePluginSettings(this)) { - d = new PrivatePluginSettings(this); + } PluginSettings::~PluginSettings() { - delete d; + } PluginSettings&PluginSettings::operator=(const PluginSettings& p) diff --git a/plugins/cvsplugin/pluginsettings.h b/plugins/cvsplugin/pluginsettings.h index d6c4cbf1..ce1552cd 100644 --- a/plugins/cvsplugin/pluginsettings.h +++ b/plugins/cvsplugin/pluginsettings.h @@ -47,7 +47,7 @@ protected: virtual void setSettingsGlobals(PluginSettingsSettings * settings, const QString & path, PluginSettings::struct_globals value); private: - PrivatePluginSettings * d; + QScopedPointer d; friend class PrivatePluginSettings; }; #endif // _PLUGINSETTINGS_H_ diff --git a/plugins/generix/docks/project/generixprojectdock.cpp b/plugins/generix/docks/project/generixprojectdock.cpp index f2597e60..16031a4d 100644 --- a/plugins/generix/docks/project/generixprojectdock.cpp +++ b/plugins/generix/docks/project/generixprojectdock.cpp @@ -133,7 +133,7 @@ QSize BusinessViewListDelegate::sizeHint(const QStyleOptionViewItem &option, con /* GenerixProjectDockImpl */ -GenerixProjectDockImpl::GenerixProjectDockImpl(QWidget * parent) : QWidget(parent) +GenerixProjectDockImpl::GenerixProjectDockImpl(QWidget * parent) : QWidget(parent), m_editorIndex(-1) { setupUi(this); setWindowTitle(tr("Generix Business View")); diff --git a/plugins/generix/plugindefinition/generix.cpp b/plugins/generix/plugindefinition/generix.cpp index 98f4ff6d..f92f6199 100644 --- a/plugins/generix/plugindefinition/generix.cpp +++ b/plugins/generix/plugindefinition/generix.cpp @@ -93,6 +93,8 @@ GenerixPlugin::GenerixPlugin() : m_dock(0) GenerixPlugin::~GenerixPlugin() { + qDebug() << "Destroy the plugin GenerixPlugin"; + qDeleteAll(m_fileTypes); } bool GenerixPlugin::initializePlugin(const QString & lang) diff --git a/plugins/services/webservicesfiletype.h b/plugins/services/webservicesfiletype.h index bf986e0b..3651fa44 100644 --- a/plugins/services/webservicesfiletype.h +++ b/plugins/services/webservicesfiletype.h @@ -38,15 +38,17 @@ public: virtual QString description() { return tr("Web Services Stream"); - }; + } + virtual QString match() { return "*.fws"; - }; + } + virtual QString icon() { return ":/services/images/typefws.png"; - }; + } virtual AbstractEditor * createEditor() { diff --git a/plugins/svnplugin/rcs_svn.cpp b/plugins/svnplugin/rcs_svn.cpp index 0792f67f..83fa2983 100644 --- a/plugins/svnplugin/rcs_svn.cpp +++ b/plugins/svnplugin/rcs_svn.cpp @@ -383,8 +383,8 @@ RCS_SVN::RCS_SVN(const QString & basePath) : RCS(basePath) RCS_SVN::~RCS_SVN() { - delete m_context; delete m_client; + delete m_context; } RCS::rcsFeatures RCS_SVN::features() const