• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • services
  • storage
  • migrator
systray.cpp
Go to the documentation of this file.
1 /*
2  * <one line to give the library's name and an idea of what it does.>
3  * Copyright 2013 Vishesh Handa <me@vhanda.in>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License or (at your option) version 3 or any later version
9  * accepted by the membership of KDE e.V. (or its successor approved
10  * by the membership of KDE e.V.), which shall act as a proxy
11  * defined in Section 14 of version 3 of the license.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #include "systray.h"
24 
25 #include <KLocalizedString>
26 #include <KTemporaryFile>
27 #include <KDebug>
28 
29 using namespace Nepomuk2;
30 
31 SysTray::SysTray(QObject* parent): KStatusNotifierItem(parent)
32 {
33  setStatus( KStatusNotifierItem::Active );
34  setIconByName( "nepomuk" );
35  setCategory( KStatusNotifierItem::SystemServices );
36  setTitle( i18n("Optimizing search database") );
37  setToolTip( "nepomuk", i18n("Optimizing search database"), QString() );
38 
39  m_storageService = new StorageService( QLatin1String("org.kde.NepomukStorage"),
40  QLatin1String("/nepomukstorage"),
41  QDBusConnection::sessionBus(), this);
42  connect( m_storageService, SIGNAL(migrateGraphsPercent(int)), this, SLOT(setPercent(int)) );
43  connect( m_storageService, SIGNAL(migrateGraphsDone()), this, SLOT(slotMigrationDone()) );
44 
45  m_storageService->migrateGraphsByBackup();
46 }
47 
48 SysTray::~SysTray()
49 {
50 }
51 
52 void SysTray::setPercent(int percent)
53 {
54  if( percent == -1 )
55  setToolTipSubTitle( i18n("In Progress") );
56  else
57  setToolTipSubTitle( i18n("Progress: %1%", percent ) );
58 }
59 
60 void SysTray::slotMigrationDone()
61 {
62  QCoreApplication::instance()->quit();
63 }
64 
65 
systray.h
QObject
Nepomuk2::SysTray::~SysTray
virtual ~SysTray()
Definition: systray.cpp:48
Nepomuk2::SysTray::SysTray
SysTray(QObject *parent=0)
Definition: systray.cpp:31
StorageService
org::kde::nepomuk::Storage StorageService
Definition: systray.h:29
KStatusNotifierItem
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal