add visibility to the config class
create an instance of the config in main() instead of the main window. configure the backend plugin to load via the config file svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1101230
This commit is contained in:
parent
156dcf9e33
commit
2e7510e816
|
@ -26,8 +26,7 @@
|
|||
#include <kpluginloader.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
static const char pluginName[] = "pluginpmlibparted";
|
||||
// static const char pluginName[] = "pluginpmdummy";
|
||||
#include <config.h>
|
||||
|
||||
CoreBackend* CoreBackend::self()
|
||||
{
|
||||
|
@ -38,7 +37,7 @@ CoreBackend* CoreBackend::self()
|
|||
|
||||
if (instance == NULL)
|
||||
{
|
||||
KPluginLoader loader(pluginName);
|
||||
KPluginLoader loader(Config::backend());
|
||||
|
||||
KPluginFactory* factory = loader.factory();
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
|
||||
<kcfg>
|
||||
<kcfgfile arg="true"/>
|
||||
|
||||
<group name="KDE Partition Manager">
|
||||
<entry name="treePartitionColumnWidths" type="IntList">
|
||||
<default>140,90,90,90,0,90,90,0,0,0,0,0</default>
|
||||
|
@ -66,5 +65,8 @@
|
|||
<entry key="showMenuBar" type="Bool">
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry key="backend" type="String">
|
||||
<default>pluginpmlibparted</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
|
|
@ -2,3 +2,7 @@ File=config.kcfg
|
|||
ClassName=Config
|
||||
Singleton=true
|
||||
Mutators=true
|
||||
Visibility=LIBPARTITIONMANAGERPRIVATE_EXPORT
|
||||
IncludeFiles=\"util/libpartitionmanagerexport.h\"
|
||||
ItemAccessors=true
|
||||
SetUserTexts=true
|
||||
|
|
|
@ -84,8 +84,6 @@ MainWindow::MainWindow(QWidget* parent, KActionCollection* coll) :
|
|||
m_StatusText(new QLabel(this)),
|
||||
m_InfoPane(new InfoPane(this))
|
||||
{
|
||||
Config::instance("partitionmanagerrc");
|
||||
|
||||
setupObjectNames();
|
||||
setupUi(this);
|
||||
init();
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <kcmdlineargs.h>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
KCmdLineArgs::init(argc, argv, createPartitionManagerAboutData());
|
||||
|
@ -43,6 +45,8 @@ int main(int argc, char* argv[])
|
|||
if (!checkPermissions())
|
||||
return 0;
|
||||
|
||||
Config::instance("partitionmanagerrc");
|
||||
|
||||
if (CoreBackend::self() == NULL)
|
||||
{
|
||||
KMessageBox::error(NULL, i18nc("@info", "The core backend plugin could not be loaded. Please check your installation."), i18nc("@title:window", "Fatal Error: Could Not Load Backend Plugin"));
|
||||
|
|
Loading…
Reference in New Issue