Code cleanup in Welcome-plugin.

Remove unused page from stacked widget form, move duplicated code
into utility functions, reduce state variables and string comparisons
in RssFetcher, clean out includes. Give WelcomeModeTreeWidget
uniform row height.
This commit is contained in:
Friedemann Kleint
2010-03-31 11:49:06 +02:00
parent d7ca762123
commit f9d2c3ad41
8 changed files with 162 additions and 152 deletions

View File

@@ -28,42 +28,22 @@
**************************************************************************/
#include "welcomeplugin.h"
#include "welcomemode.h"
#include "communitywelcomepage.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/basemode.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <QtCore/QDebug>
#include <QtCore/QtPlugin>
#include <QtGui/QAction>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
#include <QtGui/QPushButton>
using namespace Welcome::Internal;
WelcomePlugin::WelcomePlugin()
: m_welcomeMode(0), m_communityWelcomePage(0)
: m_welcomeMode(0)
{
}
WelcomePlugin::~WelcomePlugin()
{
if (m_welcomeMode) {
removeObject(m_welcomeMode);
delete m_welcomeMode;
}
if (m_communityWelcomePage) {
removeObject(m_communityWelcomePage);
delete m_communityWelcomePage;
}
}
/*! Initializes the plugin. Returns true on success.
@@ -77,11 +57,10 @@ bool WelcomePlugin::initialize(const QStringList &arguments, QString *error_mess
Q_UNUSED(arguments)
Q_UNUSED(error_message)
m_communityWelcomePage = new Internal::CommunityWelcomePage;
addObject(m_communityWelcomePage);
addAutoReleasedObject(new Internal::CommunityWelcomePage);
m_welcomeMode = new WelcomeMode;
addObject(m_welcomeMode);
addAutoReleasedObject(m_welcomeMode);
return true;
}