File indexing completed on 2024-04-14 15:48:51

0001 /***************************************************************************
0002  *   Copyright (C) 2008-2011 by Daniel Nicoletti                           *
0003  *   dantti12@gmail.com                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; see the file COPYING. If not, write to       *
0017  *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
0018  *   Boston, MA 02110-1301, USA.                                           *
0019  ***************************************************************************/
0020 
0021 #include "apperd.h"
0022 #include "ApperdThread.h"
0023 
0024 #include <QLoggingCategory>
0025 
0026 Q_LOGGING_CATEGORY(APPER_DAEMON, "apper.daemon")
0027 
0028 ApperD::ApperD(QObject *parent, const QList<QVariant> &) :
0029     KDEDModule(parent)
0030 {
0031 //    m_thread = new QThread(this);
0032     m_apperThread = new ApperdThread;
0033 //    m_apperThread->moveToThread(m_thread);
0034 //    m_thread->start();
0035 
0036     // Make all our init code run on the thread since
0037     // the DBus calls were made blocking
0038     QTimer::singleShot(0, m_apperThread, SLOT(init()));
0039 }
0040 
0041 ApperD::~ApperD()
0042 {
0043     // delete the apper thread code, don't use delete later since it has moved
0044     // to the stopped thread
0045     m_apperThread->deleteLater();
0046 //    m_thread->quit();
0047 //    m_thread->wait();
0048 //    delete m_thread;
0049 }
0050 
0051 #include "moc_apperd.cpp"