Commit 61a887a7 authored by hjk's avatar hjk Committed by hjk
Browse files

helpmanager: cleanup

Change-Id: I7bd885e9e64f8be99a040b14151cd8fba5249235
Reviewed-on: http://codereview.qt.nokia.com/4202

Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 9fd44abc
......@@ -268,7 +268,7 @@ void ShortcutSettings::defaultAction()
void ShortcutSettings::exportAction()
{
QString fileName = ICore::instance()->fileManager()->getSaveFileNameWithExtension(
QString fileName = FileManager::instance()->getSaveFileNameWithExtension(
tr("Export Keyboard Mapping Scheme"),
ICore::instance()->resourcePath() + "/schemes/",
tr("Keyboard Mapping Scheme (*.kms)"));
......
......@@ -537,9 +537,8 @@ void EditorManager::removeEditor(IEditor *editor)
{
bool isDuplicate = m_d->m_editorModel->isDuplicate(editor);
m_d->m_editorModel->removeEditor(editor);
if (!isDuplicate) {
m_d->m_core->fileManager()->removeFile(editor->file());
}
if (!isDuplicate)
FileManager::instance()->removeFile(editor->file());
m_d->m_core->removeContextObject(editor);
}
......
......@@ -50,11 +50,11 @@
namespace Core {
struct HelpManagerPrivate {
struct HelpManagerPrivate
{
HelpManagerPrivate() :
m_needsSetup(true), m_helpEngine(0), m_collectionWatcher(0) {}
static HelpManager *m_instance;
m_needsSetup(true), m_helpEngine(0), m_collectionWatcher(0)
{}
bool m_needsSetup;
QHelpEngineCore *m_helpEngine;
......@@ -65,7 +65,7 @@ struct HelpManagerPrivate {
QHash<QString, QVariant> m_customValues;
};
HelpManager *HelpManagerPrivate::m_instance = 0;
static HelpManager *m_instance = 0;
static const char linksForKeyQuery[] = "SELECT d.Title, f.Name, e.Name, "
"d.Name, a.Anchor FROM IndexTable a, FileNameTable d, FolderTable e, "
......@@ -74,12 +74,10 @@ static const char linksForKeyQuery[] = "SELECT d.Title, f.Name, e.Name, "
// -- DbCleaner
struct DbCleaner {
DbCleaner(const QString &dbName)
: name(dbName) {}
~DbCleaner() {
QSqlDatabase::removeDatabase(name);
}
struct DbCleaner
{
DbCleaner(const QString &dbName) : name(dbName) {}
~DbCleaner() { QSqlDatabase::removeDatabase(name); }
QString name;
};
......@@ -88,25 +86,23 @@ struct DbCleaner {
HelpManager::HelpManager(QObject *parent) :
QObject(parent), d(new HelpManagerPrivate)
{
Q_ASSERT(!HelpManagerPrivate::m_instance);
HelpManagerPrivate::m_instance = this;
connect(Core::ICore::instance(), SIGNAL(coreOpened()), this,
SLOT(setupHelpManager()));
Q_ASSERT(!m_instance);
m_instance = this;
connect(Core::ICore::instance(), SIGNAL(coreOpened()), SLOT(setupHelpManager()));
}
HelpManager::~HelpManager()
{
delete d->m_helpEngine;
d->m_helpEngine = 0;
HelpManagerPrivate::m_instance = 0;
m_instance = 0;
delete d;
}
HelpManager* HelpManager::instance()
HelpManager *HelpManager::instance()
{
Q_ASSERT(HelpManagerPrivate::m_instance);
return HelpManagerPrivate::m_instance;
Q_ASSERT(m_instance);
return m_instance;
}
QString HelpManager::collectionFilePath()
......
......@@ -35,8 +35,6 @@
#include "core_global.h"
#include <QtCore/QScopedPointer>
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
......@@ -99,8 +97,7 @@ private slots:
private:
void verifyDocumenation();
QScopedPointer<HelpManagerPrivate> d;
HelpManagerPrivate *d;
};
} // Core
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment