Replace some delete calls with QObject parenting.

This commit is contained in:
Klaas Freitag 2012-08-02 12:08:27 +03:00
parent 42283e4684
commit eecb444772
2 changed files with 5 additions and 11 deletions

View file

@ -113,7 +113,7 @@ Application::Application(int &argc, char **argv) :
installTranslator(mirallTranslator);
// create folder manager for sync folder management
_folderMan = new FolderMan();
_folderMan = new FolderMan(this);
connect( _folderMan, SIGNAL(folderSyncStateChange(QString)),
this,SLOT(slotSyncStateChange(QString)));
@ -187,12 +187,6 @@ Application::Application(int &argc, char **argv) :
Application::~Application()
{
qDebug() << "* Mirall shutdown";
#if QT_VERSION >= 0x040700
delete _networkMgr;
#endif
delete _folderMan;
delete _tray;
}
void Application::slotStartUpdateDetector()
@ -317,7 +311,7 @@ void Application::setupActions()
void Application::setupSystemTray()
{
_tray = new QSystemTrayIcon();
_tray = new QSystemTrayIcon(this);
_tray->setIcon( _theme->applicationIcon() ); // load the grey icon
connect(_tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),

View file

@ -55,7 +55,8 @@ ownCloudInfo::ownCloudInfo( const QString& connectionName, QObject *parent ) :
else
_connection = connectionName;
_manager = new QNetworkAccessManager;
_manager = new QNetworkAccessManager( this );
MirallConfigFile cfg( _configHandle );
QSettings settings( cfg.configFile(), QSettings::IniFormat);
QByteArray certs = settings.value(QLatin1String("CaCertificates")).toByteArray();
@ -71,7 +72,6 @@ ownCloudInfo::ownCloudInfo( const QString& connectionName, QObject *parent ) :
ownCloudInfo::~ownCloudInfo()
{
delete _manager;
delete _sslErrorDialog;
}
@ -276,7 +276,7 @@ void ownCloudInfo::slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors
}
if( _sslErrorDialog == 0 ) {
_sslErrorDialog = new SslErrorDialog();
_sslErrorDialog = new SslErrorDialog;
}
// make the ssl dialog aware of the custom config. It loads known certs.