//open main window
MMainWindow mmw;
- mmw.showMaximized();
+ mmw.show();
return app.exec();
}
#include "overview.h"
#include "webrequest.h"
+#include <QApplication>
#include <QByteArray>
#include <QCheckBox>
#include <QComboBox>
MOverview *mo=new MOverview(mw,profiles->itemData(profiles->currentIndex()).toString());
mo->show();
+ //make sure the application exits after everything is cleaned up
+ qApp->setQuitOnLastWindowClosed(false);
+ connect(mw,SIGNAL(destroyed(QObject*)),qApp,SLOT(quit()));
+
//reset main window
- password->setText("");
- setEnabled(true);
+// password->setText("");
+// setEnabled(true);
+// deleteLater();
+ hide();
}
void MMainWindow::changeLang()
#include <QtDebug>
+static QPointer<MWebRequest>sinst;
+
MWebRequest::MWebRequest(QString pid)
:temp(this,pid)
{
+ sinst=this;
profileid=pid;
webtimeout=QSettings().value("profiles/"+pid+"/webtimeout",30).toInt()*1000;
loglvl=LogLevel(QSettings().value("profiles/"+pid+"/webloglevel",LogOnError).toInt());
}
MWebRequest::~MWebRequest(){}
+MWebRequest* MWebRequest::instance(){return sinst;}
+
QString MWebRequest::dataDir()const
{
QString dd="profile."+profileid;
#include "templates.h"
#include "user.h"
-/**abstraction of requests to the web server, handles sessions and all data transfer*/
+/**abstraction of requests to the web server, handles sessions and all data transfer; singleton*/
class MWebRequest:public QObject
{
Q_OBJECT
MWebRequest(QString profileid);
~MWebRequest();
+ static MWebRequest* instance();
+
/**returns the data directory of this profile; it makes sure the directory exists*/
QString dataDir()const;