~kubuntu-members/sweeper/4.11

« back to all changes in this revision

Viewing changes to sweeper.cpp

  • Committer: Eike Krumbacher
  • Date: 2010-05-05 19:48:53 UTC
  • Revision ID: git-v1:f35681f229b96e179d95196e7516ea9431a39ea6
Tags: v4.4.85
This commit introduces modes to kcalc. Modes are groups of functionality, which one can select by menu.

FEATURE:
BUG: 229539
GUI:


svn path=/trunk/KDE/kdeutils/sweeper/; revision=1123284

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <QtDBus/QtDBus>
32
32
#include <kactioncollection.h>
33
33
 
34
 
Sweeper::Sweeper()
 
34
Sweeper::Sweeper(bool automatic)
35
35
   : KXmlGuiWindow(0)
36
36
   , m_privacyConfGroup(KSharedConfig::openConfig("kprivacyrc", KConfig::NoGlobals), "Cleaning")
 
37
   , m_automatic(automatic)
37
38
{
38
39
   QWidget *mainWidget = new QWidget(this);
39
40
   ui.setupUi(mainWidget);
66
67
   QDBusConnection::sessionBus().registerObject("/ksweeper", this);
67
68
 
68
69
   load();
 
70
 
 
71
   if(automatic) {
 
72
      cleanup();
 
73
      close();
 
74
   }
69
75
}
70
76
 
71
77
 
118
124
 
119
125
void Sweeper::cleanup()
120
126
{
121
 
   if (KMessageBox::warningContinueCancel(this, i18n("You are deleting data that is potentially valuable to you. Are you sure?")) != KMessageBox::Continue) {
122
 
      return;
 
127
   if (!m_automatic) {
 
128
      if (KMessageBox::warningContinueCancel(this, i18n("You are deleting data that is potentially valuable to you. Are you sure?")) != KMessageBox::Continue) {
 
129
         return;
 
130
      }
123
131
   }
124
132
 
125
133
   ui.statusTextEdit->clear();