]> cloud.milkyroute.net Git - dolphin.git/commitdiff
adapt Dolphin to kdelibs coding style (http://techbase.kde.org/Policies/Kdelibs_Codin...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 9 Apr 2007 19:12:54 +0000 (19:12 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 9 Apr 2007 19:12:54 +0000 (19:12 +0000)
astyle --indent=spaces=4 --brackets=linux \
       --indent-labels --pad=oper --unpad=paren \
       --one-line=keep-statements --convert-tabs \
       --indent-preprocessor \
       `find -type f -name '*.cpp'` `find -type f -name '*.h'`

svn path=/trunk/KDE/kdebase/apps/; revision=651981

56 files changed:
src/applyviewpropsjob.cpp
src/applyviewpropsjob.h
src/columnviewsettingspage.cpp
src/detailsviewsettingspage.cpp
src/dolphinapplication.cpp
src/dolphincolumnview.cpp
src/dolphincontextmenu.cpp
src/dolphincontextmenu.h
src/dolphincontroller.cpp
src/dolphincontroller.h
src/dolphindetailsview.cpp
src/dolphindirlister.cpp
src/dolphiniconsview.cpp
src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/dolphinnewmenu.cpp
src/dolphinnewmenu.h
src/dolphinsettings.h
src/dolphinsettingsdialog.cpp
src/dolphinsettingsdialog.h
src/dolphinsortfilterproxymodel.cpp
src/dolphinsortfilterproxymodel.h
src/dolphinstatusbar.cpp
src/dolphinstatusbar.h
src/dolphinview.cpp
src/dolphinview.h
src/filterbar.cpp
src/generalsettingspage.cpp
src/generalviewsettingspage.cpp
src/iconsizedialog.cpp
src/iconsizedialog.h
src/iconsviewsettingspage.cpp
src/infosidebarpage.cpp
src/infosidebarpage.h
src/main.cpp
src/metadatawidget.cpp
src/metadatawidget.h
src/pixmapviewer.cpp
src/pixmapviewer.h
src/renamedialog.cpp
src/renamedialog.h
src/settingspagebase.cpp
src/sidebarpage.cpp
src/sidebarpage.h
src/sidebartreeview.cpp
src/sidebartreeview.h
src/statusbarmessagelabel.cpp
src/statusbarmessagelabel.h
src/statusbarspaceinfo.cpp
src/statusbarspaceinfo.h
src/treeviewcontextmenu.cpp
src/treeviewsidebarpage.cpp
src/viewproperties.cpp
src/viewpropertiesdialog.cpp
src/viewpropsprogressinfo.cpp
src/viewsettingspage.cpp

index cddc4d653f8c655f0b93b9dbb60750f5090c00a1..fb48244e1cdd8d30d265abd32554bca92daedf6a 100644 (file)
 
 ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir,
                                      const ViewProperties& viewProps) :
 
 ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir,
                                      const ViewProperties& viewProps) :
-    KIO::Job(false),
-    m_viewProps(0),
-    m_progress(0),
-    m_dir(dir)
+        KIO::Job(false),
+        m_viewProps(0),
+        m_progress(0),
+        m_dir(dir)
 {
     m_viewProps = new ViewProperties(dir);
     m_viewProps->setViewMode(viewProps.viewMode());
 {
     m_viewProps = new ViewProperties(dir);
     m_viewProps->setViewMode(viewProps.viewMode());
@@ -69,7 +69,7 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list)
     for (; it != end; ++it) {
         const KIO::UDSEntry& entry = *it;
         const QString name = entry.stringValue(KIO::UDS_NAME);
     for (; it != end; ++it) {
         const KIO::UDSEntry& entry = *it;
         const QString name = entry.stringValue(KIO::UDS_NAME);
-        if ((name != ".") && (name != ".." ) && entry.isDir()) {
+        if ((name != ".") && (name != "..") && entry.isDir()) {
             ++m_progress;
 
             KUrl url(m_dir);
             ++m_progress;
 
             KUrl url(m_dir);
@@ -86,8 +86,8 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list)
 void ApplyViewPropsJob::slotResult(KJob* job)
 {
     if (job->error()) {
 void ApplyViewPropsJob::slotResult(KJob* job)
 {
     if (job->error()) {
-        setError( job->error() );
-        setErrorText( job->errorText() );
+        setError(job->error());
+        setErrorText(job->errorText());
     }
     emitResult();
 }
     }
     emitResult();
 }
index 1b49d120667fb2ffde29a720d464c6dfabae266a..cdcf305b6b7390bf06cc737fbee8b2f79ee83a5c 100644 (file)
@@ -62,7 +62,10 @@ public:
      */
     ApplyViewPropsJob(const KUrl& dir, const ViewProperties& viewProps);
     virtual ~ApplyViewPropsJob();
      */
     ApplyViewPropsJob(const KUrl& dir, const ViewProperties& viewProps);
     virtual ~ApplyViewPropsJob();
-    int progress() const { return m_progress; }
+    int progress() const
+    {
+        return m_progress;
+    }
 
 private:
     void startNextJob(const KUrl & url);
 
 private:
     void startNextJob(const KUrl & url);
index 5d9ee34f7936fe34ec2b878fb40af2fd4dec821c..cd52c362f901345c90556d70ce258f87d3ecad35 100644 (file)
 #include <QSpinBox>
 
 ColumnViewSettingsPage::ColumnViewSettingsPage(DolphinMainWindow* mainWindow,
 #include <QSpinBox>
 
 ColumnViewSettingsPage::ColumnViewSettingsPage(DolphinMainWindow* mainWindow,
-                                               QWidget* parent) :
-    KVBox(parent),
-    m_mainWindow(mainWindow),
-    m_smallIconSize(0),
-    m_mediumIconSize(0),
-    m_largeIconSize(0),
-    m_fontRequester(0)
+        QWidget* parent) :
+        KVBox(parent),
+        m_mainWindow(mainWindow),
+        m_smallIconSize(0),
+        m_mediumIconSize(0),
+        m_largeIconSize(0),
+        m_fontRequester(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -62,17 +62,17 @@ ColumnViewSettingsPage::ColumnViewSettingsPage(DolphinMainWindow* mainWindow,
     m_mediumIconSize = new QRadioButton(i18n("Medium"), this);
     m_largeIconSize  = new QRadioButton(i18n("Large"), this);
     switch (settings->iconSize()) {
     m_mediumIconSize = new QRadioButton(i18n("Medium"), this);
     m_largeIconSize  = new QRadioButton(i18n("Large"), this);
     switch (settings->iconSize()) {
-        case K3Icon::SizeLarge:
-            m_largeIconSize->setChecked(true);
-            break;
+    case K3Icon::SizeLarge:
+        m_largeIconSize->setChecked(true);
+        break;
 
 
-        case K3Icon::SizeMedium:
-            m_mediumIconSize->setChecked(true);
-            break;
+    case K3Icon::SizeMedium:
+        m_mediumIconSize->setChecked(true);
+        break;
 
 
-        case K3Icon::SizeSmall:
-        default:
-            m_smallIconSize->setChecked(true);
+    case K3Icon::SizeSmall:
+    default:
+        m_smallIconSize->setChecked(true);
     }
 
     QButtonGroup* iconSizeGroup = new QButtonGroup(this);
     }
 
     QButtonGroup* iconSizeGroup = new QButtonGroup(this);
@@ -108,8 +108,7 @@ ColumnViewSettingsPage::ColumnViewSettingsPage(DolphinMainWindow* mainWindow,
 }
 
 ColumnViewSettingsPage::~ColumnViewSettingsPage()
 }
 
 ColumnViewSettingsPage::~ColumnViewSettingsPage()
-{
-}
+{}
 
 void ColumnViewSettingsPage::applySettings()
 {
 
 void ColumnViewSettingsPage::applySettings()
 {
@@ -119,8 +118,7 @@ void ColumnViewSettingsPage::applySettings()
     int iconSize = K3Icon::SizeSmall;
     if (m_mediumIconSize->isChecked()) {
         iconSize = K3Icon::SizeMedium;
     int iconSize = K3Icon::SizeSmall;
     if (m_mediumIconSize->isChecked()) {
         iconSize = K3Icon::SizeMedium;
-    }
-    else if (m_largeIconSize->isChecked()) {
+    } else if (m_largeIconSize->isChecked()) {
         iconSize = K3Icon::SizeLarge;
     }
     settings->setIconSize(iconSize);
         iconSize = K3Icon::SizeLarge;
     }
     settings->setIconSize(iconSize);
index 9a9d550936062ad70b4c593cd05757101303097c..7ec11b1538fc0ea25f482d393201a662b5220f27 100644 (file)
 #include <QSpinBox>
 
 DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
 #include <QSpinBox>
 
 DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
-                                                 QWidget* parent) :
-    KVBox(parent),
-    m_mainWindow(mainWindow),
-    m_dateBox(0),
-    m_permissionsBox(0),
-    m_ownerBox(0),
-    m_groupBox(0),
-    m_smallIconSize(0),
-    m_mediumIconSize(0),
-    m_largeIconSize(0),
-    m_fontRequester(0)
+        QWidget* parent) :
+        KVBox(parent),
+        m_mainWindow(mainWindow),
+        m_dateBox(0),
+        m_permissionsBox(0),
+        m_ownerBox(0),
+        m_groupBox(0),
+        m_smallIconSize(0),
+        m_mediumIconSize(0),
+        m_largeIconSize(0),
+        m_fontRequester(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -88,17 +88,17 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
     m_mediumIconSize = new QRadioButton(i18n("Medium"), this);
     m_largeIconSize  = new QRadioButton(i18n("Large"), this);
     switch (settings->iconSize()) {
     m_mediumIconSize = new QRadioButton(i18n("Medium"), this);
     m_largeIconSize  = new QRadioButton(i18n("Large"), this);
     switch (settings->iconSize()) {
-        case K3Icon::SizeLarge:
-            m_largeIconSize->setChecked(true);
-            break;
+    case K3Icon::SizeLarge:
+        m_largeIconSize->setChecked(true);
+        break;
 
 
-        case K3Icon::SizeMedium:
-            m_mediumIconSize->setChecked(true);
-            break;
+    case K3Icon::SizeMedium:
+        m_mediumIconSize->setChecked(true);
+        break;
 
 
-        case K3Icon::SizeSmall:
-        default:
-            m_smallIconSize->setChecked(true);
+    case K3Icon::SizeSmall:
+    default:
+        m_smallIconSize->setChecked(true);
     }
 
     QButtonGroup* iconSizeGroup = new QButtonGroup(this);
     }
 
     QButtonGroup* iconSizeGroup = new QButtonGroup(this);
@@ -134,8 +134,7 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(DolphinMainWindow* mainWindow,
 }
 
 DetailsViewSettingsPage::~DetailsViewSettingsPage()
 }
 
 DetailsViewSettingsPage::~DetailsViewSettingsPage()
-{
-}
+{}
 
 void DetailsViewSettingsPage::applySettings()
 {
 
 void DetailsViewSettingsPage::applySettings()
 {
@@ -150,8 +149,7 @@ void DetailsViewSettingsPage::applySettings()
     int iconSize = K3Icon::SizeSmall;
     if (m_mediumIconSize->isChecked()) {
         iconSize = K3Icon::SizeMedium;
     int iconSize = K3Icon::SizeSmall;
     if (m_mediumIconSize->isChecked()) {
         iconSize = K3Icon::SizeMedium;
-    }
-    else if (m_largeIconSize->isChecked()) {
+    } else if (m_largeIconSize->isChecked()) {
         iconSize = K3Icon::SizeLarge;
     }
     settings->setIconSize(iconSize);
         iconSize = K3Icon::SizeLarge;
     }
     settings->setIconSize(iconSize);
index 9e6d0565f5b7fd19e461459ad59ea14cfb659ae5..ad345dbebdcba7f90f042da943054692e90b11e8 100644 (file)
@@ -27,7 +27,7 @@
 #include <QDBusConnection>
 
 DolphinApplication::DolphinApplication() :
 #include <QDBusConnection>
 
 DolphinApplication::DolphinApplication() :
-    m_lastId(0)
+        m_lastId(0)
 {
     new ApplicationAdaptor(this);
     QDBusConnection::sessionBus().registerObject("/dolphin/Application", this);
 {
     new ApplicationAdaptor(this);
     QDBusConnection::sessionBus().registerObject("/dolphin/Application", this);
@@ -78,8 +78,7 @@ int DolphinApplication::newInstance()
         for (int i = 0; i < args->count(); ++i) {
             openWindow(args->arg(i));
         }
         for (int i = 0; i < args->count(); ++i) {
             openWindow(args->arg(i));
         }
-    }
-    else {
+    } else {
         openWindow(QString());
     }
 
         openWindow(QString());
     }
 
index 9ce51dbd2e1187a7a254e319c64055da01cc8d75..c50314c97e6cd699d9cda2bca7d2556e3b4959af 100644 (file)
@@ -32,8 +32,8 @@
 #include <QPoint>
 
 DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* controller) :
 #include <QPoint>
 
 DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* controller) :
-    QColumnView(parent),
-    m_controller(controller)
+        QColumnView(parent),
+        m_controller(controller)
 {
     Q_ASSERT(controller != 0);
 
 {
     Q_ASSERT(controller != 0);
 
@@ -53,7 +53,7 @@ DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* control
     connect(controller, SIGNAL(zoomOut()),
             this, SLOT(zoomOut()));
 
     connect(controller, SIGNAL(zoomOut()),
             this, SLOT(zoomOut()));
 
-   // apply the column mode settings to the widget
+    // apply the column mode settings to the widget
     const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
     Q_ASSERT(settings != 0);
 
     const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
     Q_ASSERT(settings != 0);
 
@@ -68,8 +68,7 @@ DolphinColumnView::DolphinColumnView(QWidget* parent, DolphinController* control
 }
 
 DolphinColumnView::~DolphinColumnView()
 }
 
 DolphinColumnView::~DolphinColumnView()
-{
-}
+{}
 
 QStyleOptionViewItem DolphinColumnView::viewOptions() const
 {
 
 QStyleOptionViewItem DolphinColumnView::viewOptions() const
 {
@@ -113,9 +112,9 @@ void DolphinColumnView::zoomIn()
         ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
         ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
-            case K3Icon::SizeSmall:  settings->setIconSize(K3Icon::SizeMedium); break;
-            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeLarge); break;
-            default: Q_ASSERT(false); break;
+        case K3Icon::SizeSmall:  settings->setIconSize(K3Icon::SizeMedium); break;
+        case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeLarge); break;
+        default: Q_ASSERT(false); break;
         }
         updateDecorationSize();
     }
         }
         updateDecorationSize();
     }
@@ -123,13 +122,13 @@ void DolphinColumnView::zoomIn()
 
 void DolphinColumnView::zoomOut()
 {
 
 void DolphinColumnView::zoomOut()
 {
-   if (isZoomOutPossible()) {
+    if (isZoomOutPossible()) {
         ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
         ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
-            case K3Icon::SizeLarge:  settings->setIconSize(K3Icon::SizeMedium); break;
-            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeSmall); break;
-            default: Q_ASSERT(false); break;
+        case K3Icon::SizeLarge:  settings->setIconSize(K3Icon::SizeMedium); break;
+        case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeSmall); break;
+        default: Q_ASSERT(false); break;
         }
         updateDecorationSize();
     }
         }
         updateDecorationSize();
     }
index 79fded599932ab98069a023ce26ea8fc0c98db97..752f28e12cb74b2e5f11f9aafe42edbcbe6f42f3 100644 (file)
 DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
                                        KFileItem* fileInfo,
                                        const KUrl& baseUrl) :
 DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
                                        KFileItem* fileInfo,
                                        const KUrl& baseUrl) :
-    m_mainWindow(parent),
-    m_fileInfo(fileInfo),
-    m_baseUrl(baseUrl),
-    m_context(NoContext)
+        m_mainWindow(parent),
+        m_fileInfo(fileInfo),
+        m_baseUrl(baseUrl),
+        m_context(NoContext)
 {
     // The context menu either accesses the URLs of the selected items
     // or the items itself. To increase the performance both lists are cached.
 {
     // The context menu either accesses the URLs of the selected items
     // or the items itself. To increase the performance both lists are cached.
@@ -63,8 +63,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
 }
 
 DolphinContextMenu::~DolphinContextMenu()
 }
 
 DolphinContextMenu::~DolphinContextMenu()
-{
-}
+{}
 
 void DolphinContextMenu::open()
 {
 
 void DolphinContextMenu::open()
 {
@@ -76,21 +75,18 @@ void DolphinContextMenu::open()
     if (m_fileInfo != 0) {
         m_context |= ItemContext;
         // TODO: handle other use cases like devices + desktop files
     if (m_fileInfo != 0) {
         m_context |= ItemContext;
         // TODO: handle other use cases like devices + desktop files
-   }
+    }
 
     // open the corresponding popup for the context
     if (m_context & TrashContext) {
         if (m_context & ItemContext) {
             openTrashItemContextMenu();
 
     // open the corresponding popup for the context
     if (m_context & TrashContext) {
         if (m_context & ItemContext) {
             openTrashItemContextMenu();
-        }
-        else {
+        } else {
             openTrashContextMenu();
         }
             openTrashContextMenu();
         }
-    }
-    else if (m_context & ItemContext) {
+    } else if (m_context & ItemContext) {
         openItemContextMenu();
         openItemContextMenu();
-    }
-    else {
+    } else {
         Q_ASSERT(m_context == NoContext);
         openViewportContextMenu();
     }
         Q_ASSERT(m_context == NoContext);
         openViewportContextMenu();
     }
@@ -114,10 +110,10 @@ void DolphinContextMenu::openTrashContextMenu()
     if (popup->exec(QCursor::pos()) == emptyTrashAction) {
         const QString text(i18n("Do you really want to empty the Trash? All items will get deleted."));
         const bool del = KMessageBox::warningContinueCancel(m_mainWindow,
     if (popup->exec(QCursor::pos()) == emptyTrashAction) {
         const QString text(i18n("Do you really want to empty the Trash? All items will get deleted."));
         const bool del = KMessageBox::warningContinueCancel(m_mainWindow,
-                                                            text,
-                                                            QString(),
-                                                            KGuiItem(i18n("Empty Trash"), KIcon("user-trash"))
-                                                            ) == KMessageBox::Continue;
+                         text,
+                         QString(),
+                         KGuiItem(i18n("Empty Trash"), KIcon("user-trash"))
+                                                           ) == KMessageBox::Continue;
         if (del) {
             KonqOperations::emptyTrash(m_mainWindow);
         }
         if (del) {
             KonqOperations::emptyTrash(m_mainWindow);
         }
@@ -179,25 +175,22 @@ void DolphinContextMenu::openItemContextMenu()
 
     QAction* activatedAction = popup->exec(QCursor::pos());
 
 
     QAction* activatedAction = popup->exec(QCursor::pos());
 
-    if ((bookmarkAction!= 0) && (activatedAction == bookmarkAction)) {
+    if ((bookmarkAction != 0) && (activatedAction == bookmarkAction)) {
         const KUrl selectedUrl(m_fileInfo->url());
         if (selectedUrl.isValid()) {
             DolphinSettings::instance().placesModel()->addPlace(selectedUrl.fileName(),
         const KUrl selectedUrl(m_fileInfo->url());
         if (selectedUrl.isValid()) {
             DolphinSettings::instance().placesModel()->addPlace(selectedUrl.fileName(),
-                                                                selectedUrl);
+                    selectedUrl);
         }
         }
-    }
-    else if (serviceActions.contains(activatedAction)) {
+    } else if (serviceActions.contains(activatedAction)) {
         // one of the 'Actions' items has been selected
         int id = serviceActions.indexOf(activatedAction);
         KDesktopFileActions::executeService(m_selectedUrls, actionsVector[id]);
         // one of the 'Actions' items has been selected
         int id = serviceActions.indexOf(activatedAction);
         KDesktopFileActions::executeService(m_selectedUrls, actionsVector[id]);
-    }
-    else if (openWithActions.contains(activatedAction)) {
+    } else if (openWithActions.contains(activatedAction)) {
         // one of the 'Open With' items has been selected
         if (openWithActions.last() == activatedAction) {
             // the item 'Other...' has been selected
             KRun::displayOpenWithDialog(m_selectedUrls, m_mainWindow);
         // one of the 'Open With' items has been selected
         if (openWithActions.last() == activatedAction) {
             // the item 'Other...' has been selected
             KRun::displayOpenWithDialog(m_selectedUrls, m_mainWindow);
-        }
-        else {
+        } else {
             int id = openWithActions.indexOf(activatedAction);
             KService::Ptr servicePtr = openWithVector[id];
             KRun::run(*servicePtr, m_selectedUrls, m_mainWindow);
             int id = openWithActions.indexOf(activatedAction);
             KService::Ptr servicePtr = openWithVector[id];
             KRun::run(*servicePtr, m_selectedUrls, m_mainWindow);
@@ -247,8 +240,7 @@ void DolphinContextMenu::openViewportContextMenu()
     QAction* activatedAction = popup->exec(QCursor::pos());
     if (activatedAction == propertiesAction) {
         new KPropertiesDialog(m_mainWindow->activeView()->url());
     QAction* activatedAction = popup->exec(QCursor::pos());
     if (activatedAction == propertiesAction) {
         new KPropertiesDialog(m_mainWindow->activeView()->url());
-    }
-    else if (activatedAction == bookmarkAction) {
+    } else if (activatedAction == bookmarkAction) {
         const KUrl& url = m_mainWindow->activeView()->url();
         if (url.isValid()) {
             DolphinSettings::instance().placesModel()->addPlace(url.fileName(), url);
         const KUrl& url = m_mainWindow->activeView()->url();
         if (url.isValid()) {
             DolphinSettings::instance().placesModel()->addPlace(url.fileName(), url);
@@ -285,8 +277,7 @@ void DolphinContextMenu::insertDefaultItemActions(KMenu* popup)
     if (url.isLocalFile()) {
         QAction* moveToTrashAction = collection->action("move_to_trash");
         popup->addAction(moveToTrashAction);
     if (url.isLocalFile()) {
         QAction* moveToTrashAction = collection->action("move_to_trash");
         popup->addAction(moveToTrashAction);
-    }
-    else {
+    } else {
         showDeleteCommand = true;
     }
 
         showDeleteCommand = true;
     }
 
@@ -297,7 +288,7 @@ void DolphinContextMenu::insertDefaultItemActions(KMenu* popup)
 }
 
 QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
 }
 
 QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
-                                                        QVector<KService::Ptr>& openWithVector)
+        QVector<KService::Ptr>& openWithVector)
 {
     // Parts of the following code have been taken
     // from the class KonqOperations located in
 {
     // Parts of the following code have been taken
     // from the class KonqOperations located in
@@ -322,12 +313,12 @@ QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
         // fill the 'Open with' sub menu with application types
         const KMimeType::Ptr mimePtr = KMimeType::findByUrl(m_fileInfo->url());
         KService::List offers = KMimeTypeTrader::self()->query(mimePtr->name(),
         // fill the 'Open with' sub menu with application types
         const KMimeType::Ptr mimePtr = KMimeType::findByUrl(m_fileInfo->url());
         KService::List offers = KMimeTypeTrader::self()->query(mimePtr->name(),
-                                                               "Application",
-                                                               "Type == 'Application'");
+                                "Application",
+                                "Type == 'Application'");
         if (offers.count() > 0) {
             KService::List::Iterator it;
             KMenu* openWithMenu = new KMenu(i18n("Open With"));
         if (offers.count() > 0) {
             KService::List::Iterator it;
             KMenu* openWithMenu = new KMenu(i18n("Open With"));
-            for(it = offers.begin(); it != offers.end(); ++it) {
+            for (it = offers.begin(); it != offers.end(); ++it) {
                 // The offer list from the KTrader returns duplicate
                 // application entries. Although this seems to be a configuration
                 // problem outside the scope of Dolphin, duplicated entries just
                 // The offer list from the KTrader returns duplicate
                 // application entries. Although this seems to be a configuration
                 // problem outside the scope of Dolphin, duplicated entries just
@@ -346,16 +337,14 @@ QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
 
             openWithActions << action;
             popup->addMenu(openWithMenu);
 
             openWithActions << action;
             popup->addMenu(openWithMenu);
-        }
-        else {
+        } else {
             // No applications are registered, hence just offer
             // a "Open With..." item instead of a sub menu containing
             // only one entry.
             QAction* action = popup->addAction(i18n("Open With..."));
             openWithActions << action;
         }
             // No applications are registered, hence just offer
             // a "Open With..." item instead of a sub menu containing
             // only one entry.
             QAction* action = popup->addAction(i18n("Open With..."));
             openWithActions << action;
         }
-    }
-    else {
+    } else {
         // At least one of the selected items has a different MIME type. In this case
         // just show a disabled "Open With..." entry.
         QAction* action = popup->addAction(i18n("Open With..."));
         // At least one of the selected items has a different MIME type. In this case
         // just show a disabled "Open With..." entry.
         QAction* action = popup->addAction(i18n("Open With..."));
@@ -366,7 +355,7 @@ QList<QAction*> DolphinContextMenu::insertOpenWithItems(KMenu* popup,
 }
 
 QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
 }
 
 QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
-                                                      QVector<KDesktopFileActions::Service>& actionsVector)
+        QVector<KDesktopFileActions::Service>& actionsVector)
 {
     // Parts of the following code have been taken
     // from the class KonqOperations located in
 {
     // Parts of the following code have been taken
     // from the class KonqOperations located in
@@ -388,7 +377,7 @@ QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
         QStringList entries = dir.entryList(QDir::Files);
 
         for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
         QStringList entries = dir.entryList(QDir::Files);
 
         for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
-            KConfigGroup cfg(KSharedConfig::openConfig( *dirIt + *entryIt, KConfig::OnlyLocal), "Desktop Entry" );
+            KConfigGroup cfg(KSharedConfig::openConfig(*dirIt + *entryIt, KConfig::OnlyLocal), "Desktop Entry");
             if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
                 //const QStringList types = cfg.readListEntry("ServiceTypes");
                 QStringList types;
             if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
                 //const QStringList types = cfg.readListEntry("ServiceTypes");
                 QStringList types;
@@ -429,7 +418,7 @@ QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
                     if (insert) {
                         menu = actionsMenu;
 
                     if (insert) {
                         menu = actionsMenu;
 
-                        const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
+                        const QString submenuName = cfg.readEntry("X-KDE-Submenu");
                         if (!submenuName.isEmpty()) {
                             menu = new KMenu(submenuName);
                             actionsMenu->addMenu(menu);
                         if (!submenuName.isEmpty()) {
                             menu = new KMenu(submenuName);
                             actionsMenu->addMenu(menu);
@@ -445,8 +434,7 @@ QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
                                 QAction* action = menu->addAction(KIcon(service.m_strIcon),
                                                                   service.m_strName);
                                 serviceActions << action;
                                 QAction* action = menu->addAction(KIcon(service.m_strIcon),
                                                                   service.m_strName);
                                 serviceActions << action;
-                            }
-                            else {
+                            } else {
                                 QAction *action = menu->addAction(service.m_strName);
                                 serviceActions << action;
                             }
                                 QAction *action = menu->addAction(service.m_strName);
                                 serviceActions << action;
                             }
@@ -479,21 +467,18 @@ QList<QAction*> DolphinContextMenu::insertActionItems(KMenu* popup,
                 QAction* action = popup->addAction(text);
                 serviceActions.clear();
                 serviceActions << action;
                 QAction* action = popup->addAction(text);
                 serviceActions.clear();
                 serviceActions << action;
-            }
-            else {
+            } else {
                 QAction* action = popup->addAction(icon, text);
                 serviceActions.clear();
                 serviceActions << action;
             }
                 QAction* action = popup->addAction(icon, text);
                 serviceActions.clear();
                 serviceActions << action;
             }
-        }
-        else {
+        } else {
             // The item is a sub menu, hence show the sub menu in the root menu.
             popup->addMenu(menu);
         }
         actionsMenu->deleteLater();
         actionsMenu = 0;
             // The item is a sub menu, hence show the sub menu in the root menu.
             popup->addMenu(menu);
         }
         actionsMenu->deleteLater();
         actionsMenu = 0;
-    }
-    else {
+    } else {
         popup->addMenu(actionsMenu);
     }
 
         popup->addMenu(actionsMenu);
     }
 
index 5674c96c31da4cbb67669488c7c694a35da4fff6..17c9802154332bb1c27ed18fead69aa180594bcf 100644 (file)
@@ -109,7 +109,8 @@ private:
                        const QString& entryName) const;
 
 private:
                        const QString& entryName) const;
 
 private:
-    struct Entry {
+    struct Entry
+    {
         int type;
         QString name;
         QString filePath;     // empty for separator
         int type;
         QString name;
         QString filePath;     // empty for separator
@@ -118,7 +119,8 @@ private:
         QString comment;
     };
 
         QString comment;
     };
 
-    enum ContextType {
+    enum ContextType
+    {
         NoContext = 0,
         ItemContext = 1,
         TrashContext = 2
         NoContext = 0,
         ItemContext = 1,
         TrashContext = 2
index 28808353317957455d8c90a0e06974aa2ef8d34b..151d2720854b039e98bc7c507177511c5c02b2e0 100644 (file)
 #include "dolphincontroller.h"
 
 DolphinController::DolphinController(QObject* parent) :
 #include "dolphincontroller.h"
 
 DolphinController::DolphinController(QObject* parent) :
-    QObject(parent),
-    m_showPreview(false),
-    m_zoomInPossible(false),
-    m_zoomOutPossible(false)
-{
-}
+        QObject(parent),
+        m_showPreview(false),
+        m_zoomInPossible(false),
+        m_zoomOutPossible(false)
+{}
 
 DolphinController::~DolphinController()
 
 DolphinController::~DolphinController()
-{
-}
+{}
 
 void DolphinController::triggerContextMenuRequest(const QPoint& pos)
 {
 
 void DolphinController::triggerContextMenuRequest(const QPoint& pos)
 {
@@ -43,8 +41,8 @@ void DolphinController::triggerActivation()
 }
 
 void DolphinController::indicateDroppedUrls(const KUrl::List& urls,
 }
 
 void DolphinController::indicateDroppedUrls(const KUrl::List& urls,
-                                            const QModelIndex& index,
-                                            QWidget* source)
+        const QModelIndex& index,
+        QWidget* source)
 {
     emit urlsDropped(urls, index, source);
 }
 {
     emit urlsDropped(urls, index, source);
 }
index af5ac35175211d89d82830ac39227e1d649755e9..f9f4f4e4716d05daec5469e8274ebe41ef251cfe 100644 (file)
@@ -54,8 +54,14 @@ public:
     explicit DolphinController(QObject* parent);
     virtual ~DolphinController();
 
     explicit DolphinController(QObject* parent);
     virtual ~DolphinController();
 
-    void setUrl(const KUrl& url) { m_url = url; }
-    const KUrl& url() const { return m_url; }
+    void setUrl(const KUrl& url)
+    {
+        m_url = url;
+    }
+    const KUrl& url() const
+    {
+        return m_url;
+    }
 
     void triggerContextMenuRequest(const QPoint& pos);
 
 
     void triggerContextMenuRequest(const QPoint& pos);
 
@@ -70,15 +76,30 @@ public:
     void indicateSortOrderChange(Qt::SortOrder order);
 
     void setShowPreview(bool showPreview);
     void indicateSortOrderChange(Qt::SortOrder order);
 
     void setShowPreview(bool showPreview);
-    bool showPreview() const { return m_showPreview; }
+    bool showPreview() const
+    {
+        return m_showPreview;
+    }
 
     void triggerZoomIn();
 
     void triggerZoomIn();
-    void setZoomInPossible(bool possible) { m_zoomInPossible = possible; }
-    bool isZoomInPossible() const { return m_zoomInPossible; }
+    void setZoomInPossible(bool possible)
+    {
+        m_zoomInPossible = possible;
+    }
+    bool isZoomInPossible() const
+    {
+        return m_zoomInPossible;
+    }
 
     void triggerZoomOut();
 
     void triggerZoomOut();
-    void setZoomOutPossible(bool possible) { m_zoomOutPossible = possible; }
-    bool isZoomOutPossible() const { return m_zoomOutPossible; }
+    void setZoomOutPossible(bool possible)
+    {
+        m_zoomOutPossible = possible;
+    }
+    bool isZoomOutPossible() const
+    {
+        return m_zoomOutPossible;
+    }
 
 public slots:
     void triggerItem(const QModelIndex& index);
 
 public slots:
     void triggerItem(const QModelIndex& index);
index dc05ef3ea3627d6cf8df73501dfcb47c2b4deaa2..88537471bbd10a01d4241c11216f7a4539899f94 100644 (file)
@@ -33,8 +33,8 @@
 #include <QHeaderView>
 
 DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* controller) :
 #include <QHeaderView>
 
 DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* controller) :
-    QTreeView(parent),
-    m_controller(controller)
+        QTreeView(parent),
+        m_controller(controller)
 {
     Q_ASSERT(controller != 0);
 
 {
     Q_ASSERT(controller != 0);
 
@@ -85,8 +85,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
 }
 
 DolphinDetailsView::~DolphinDetailsView()
 }
 
 DolphinDetailsView::~DolphinDetailsView()
-{
-}
+{}
 
 bool DolphinDetailsView::event(QEvent* event)
 {
 
 bool DolphinDetailsView::event(QEvent* event)
 {
@@ -186,9 +185,9 @@ void DolphinDetailsView::zoomIn()
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
-            case K3Icon::SizeSmall:  settings->setIconSize(K3Icon::SizeMedium); break;
-            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeLarge); break;
-            default: Q_ASSERT(false); break;
+        case K3Icon::SizeSmall:  settings->setIconSize(K3Icon::SizeMedium); break;
+        case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeLarge); break;
+        default: Q_ASSERT(false); break;
         }
         updateDecorationSize();
     }
         }
         updateDecorationSize();
     }
@@ -200,9 +199,9 @@ void DolphinDetailsView::zoomOut()
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
         DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
         // TODO: get rid of K3Icon sizes
         switch (settings->iconSize()) {
-            case K3Icon::SizeLarge:  settings->setIconSize(K3Icon::SizeMedium); break;
-            case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeSmall); break;
-            default: Q_ASSERT(false); break;
+        case K3Icon::SizeLarge:  settings->setIconSize(K3Icon::SizeMedium); break;
+        case K3Icon::SizeMedium: settings->setIconSize(K3Icon::SizeSmall); break;
+        default: Q_ASSERT(false); break;
         }
         updateDecorationSize();
     }
         }
         updateDecorationSize();
     }
index 8da962b18ad9c5f5e3859ea30ee3674982957983..a88acc937d9d44a36b4bfdeeb745efce2fc37d67 100644 (file)
 #include <kio/jobclasses.h>
 
 DolphinDirLister::DolphinDirLister() :
 #include <kio/jobclasses.h>
 
 DolphinDirLister::DolphinDirLister() :
-    KDirLister()
-{
-}
+        KDirLister()
+{}
 
 DolphinDirLister::~DolphinDirLister()
 
 DolphinDirLister::~DolphinDirLister()
-{
-}
+{}
 
 void DolphinDirLister::handleError(KIO::Job* job)
 {
 
 void DolphinDirLister::handleError(KIO::Job* job)
 {
index 0b9b1e6fa3c768d6e203ff39fb48a76110df7f7b..63989a30dcf4485a8596ed82767711aad9e465be 100644 (file)
@@ -32,8 +32,8 @@
 #include <QPoint>
 
 DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
 #include <QPoint>
 
 DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controller) :
-    QListView(parent),
-    m_controller(controller)
+        QListView(parent),
+        m_controller(controller)
 {
     Q_ASSERT(controller != 0);
     setViewMode(QListView::IconMode);
 {
     Q_ASSERT(controller != 0);
     setViewMode(QListView::IconMode);
@@ -68,16 +68,14 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
     if (settings->arrangement() == QListView::TopToBottom) {
         setFlow(QListView::LeftToRight);
         m_viewOptions.decorationPosition = QStyleOptionViewItem::Top;
     if (settings->arrangement() == QListView::TopToBottom) {
         setFlow(QListView::LeftToRight);
         m_viewOptions.decorationPosition = QStyleOptionViewItem::Top;
-    }
-    else {
+    } else {
         setFlow(QListView::TopToBottom);
         m_viewOptions.decorationPosition = QStyleOptionViewItem::Left;
     }
 }
 
 DolphinIconsView::~DolphinIconsView()
         setFlow(QListView::TopToBottom);
         m_viewOptions.decorationPosition = QStyleOptionViewItem::Left;
     }
 }
 
 DolphinIconsView::~DolphinIconsView()
-{
-}
+{}
 
 QStyleOptionViewItem DolphinIconsView::viewOptions() const
 {
 
 QStyleOptionViewItem DolphinIconsView::viewOptions() const
 {
@@ -153,8 +151,7 @@ void DolphinIconsView::zoomIn()
         if (showPreview) {
             const int previewSize = increasedIconSize(settings->previewSize());
             settings->setPreviewSize(previewSize);
         if (showPreview) {
             const int previewSize = increasedIconSize(settings->previewSize());
             settings->setPreviewSize(previewSize);
-        }
-        else {
+        } else {
             newIconSize = increasedIconSize(oldIconSize);
             settings->setIconSize(newIconSize);
             if (settings->previewSize() < newIconSize) {
             newIconSize = increasedIconSize(oldIconSize);
             settings->setIconSize(newIconSize);
             if (settings->previewSize() < newIconSize) {
@@ -189,8 +186,7 @@ void DolphinIconsView::zoomOut()
                 newIconSize = previewSize;
                 settings->setIconSize(newIconSize);
             }
                 newIconSize = previewSize;
                 settings->setIconSize(newIconSize);
             }
-        }
-        else {
+        } else {
             newIconSize = decreasedIconSize(settings->iconSize());
             settings->setIconSize(newIconSize);
         }
             newIconSize = decreasedIconSize(settings->iconSize());
             settings->setIconSize(newIconSize);
         }
@@ -223,12 +219,12 @@ int DolphinIconsView::increasedIconSize(int size) const
     // TODO: get rid of K3Icon sizes
     int incSize = 0;
     switch (size) {
     // TODO: get rid of K3Icon sizes
     int incSize = 0;
     switch (size) {
-        case K3Icon::SizeSmall:       incSize = K3Icon::SizeSmallMedium; break;
-        case K3Icon::SizeSmallMedium: incSize = K3Icon::SizeMedium; break;
-        case K3Icon::SizeMedium:      incSize = K3Icon::SizeLarge; break;
-        case K3Icon::SizeLarge:       incSize = K3Icon::SizeHuge; break;
-        case K3Icon::SizeHuge:        incSize = K3Icon::SizeEnormous; break;
-        default: Q_ASSERT(false); break;
+    case K3Icon::SizeSmall:       incSize = K3Icon::SizeSmallMedium; break;
+    case K3Icon::SizeSmallMedium: incSize = K3Icon::SizeMedium; break;
+    case K3Icon::SizeMedium:      incSize = K3Icon::SizeLarge; break;
+    case K3Icon::SizeLarge:       incSize = K3Icon::SizeHuge; break;
+    case K3Icon::SizeHuge:        incSize = K3Icon::SizeEnormous; break;
+    default: Q_ASSERT(false); break;
     }
     return incSize;
 }
     }
     return incSize;
 }
@@ -238,12 +234,12 @@ int DolphinIconsView::decreasedIconSize(int size) const
     // TODO: get rid of K3Icon sizes
     int decSize = 0;
     switch (size) {
     // TODO: get rid of K3Icon sizes
     int decSize = 0;
     switch (size) {
-        case K3Icon::SizeSmallMedium: decSize = K3Icon::SizeSmall; break;
-        case K3Icon::SizeMedium: decSize = K3Icon::SizeSmallMedium; break;
-        case K3Icon::SizeLarge: decSize = K3Icon::SizeMedium; break;
-        case K3Icon::SizeHuge: decSize = K3Icon::SizeLarge; break;
-        case K3Icon::SizeEnormous: decSize = K3Icon::SizeHuge; break;
-        default: Q_ASSERT(false); break;
+    case K3Icon::SizeSmallMedium: decSize = K3Icon::SizeSmall; break;
+    case K3Icon::SizeMedium: decSize = K3Icon::SizeSmallMedium; break;
+    case K3Icon::SizeLarge: decSize = K3Icon::SizeMedium; break;
+    case K3Icon::SizeHuge: decSize = K3Icon::SizeLarge; break;
+    case K3Icon::SizeEnormous: decSize = K3Icon::SizeHuge; break;
+    default: Q_ASSERT(false); break;
     }
     return decSize;
 }
     }
     return decSize;
 }
index 1e55d0b5524f8df7a01a86adca6b1f1906ffcfcd..3a375ebb93365830980a80fff837a77f96d61261 100644 (file)
 #include <QDockWidget>
 
 DolphinMainWindow::DolphinMainWindow(int id) :
 #include <QDockWidget>
 
 DolphinMainWindow::DolphinMainWindow(int id) :
-    KMainWindow(0),
-    m_newMenu(0),
-    m_splitter(0),
-    m_activeView(0),
-    m_id(id)
+        KMainWindow(0),
+        m_newMenu(0),
+        m_splitter(0),
+        m_activeView(0),
+        m_id(id)
 {
     setObjectName("Dolphin");
     m_view[PrimaryIdx] = 0;
 {
     setObjectName("Dolphin");
     m_view[PrimaryIdx] = 0;
@@ -133,16 +133,13 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
     if (shiftPressed && controlPressed) {
         // shortcut for 'Link Here' is used
         action = Qt::LinkAction;
     if (shiftPressed && controlPressed) {
         // shortcut for 'Link Here' is used
         action = Qt::LinkAction;
-    }
-    else if (shiftPressed) {
+    } else if (shiftPressed) {
         // shortcut for 'Move Here' is used
         action = Qt::MoveAction;
         // shortcut for 'Move Here' is used
         action = Qt::MoveAction;
-    }
-    else if (controlPressed) {
+    } else if (controlPressed) {
         // shortcut for 'Copy Here' is used
         action = Qt::CopyAction;
         // shortcut for 'Copy Here' is used
         action = Qt::CopyAction;
-    }
-    else {
+    } else {
         // open a context menu which offers the following actions:
         // - Move Here
         // - Copy Here
         // open a context menu which offers the following actions:
         // - Move Here
         // - Copy Here
@@ -172,33 +169,30 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
         QAction* activatedAction = popup.exec(QCursor::pos());
         if (activatedAction == moveAction) {
             action = Qt::MoveAction;
         QAction* activatedAction = popup.exec(QCursor::pos());
         if (activatedAction == moveAction) {
             action = Qt::MoveAction;
-        }
-        else if (activatedAction == copyAction) {
+        } else if (activatedAction == copyAction) {
             action = Qt::CopyAction;
             action = Qt::CopyAction;
-        }
-        else if (activatedAction == linkAction) {
+        } else if (activatedAction == linkAction) {
             action = Qt::LinkAction;
             action = Qt::LinkAction;
-        }
-        else {
+        } else {
             return;
         }
     }
 
     switch (action) {
             return;
         }
     }
 
     switch (action) {
-        case Qt::MoveAction:
-            moveUrls(urls, destination);
-            break;
+    case Qt::MoveAction:
+        moveUrls(urls, destination);
+        break;
 
 
-        case Qt::CopyAction:
-            copyUrls(urls, destination);
-            break;
+    case Qt::CopyAction:
+        copyUrls(urls, destination);
+        break;
 
 
-        case Qt::LinkAction:
-            linkUrls(urls, destination);
-            break;
+    case Qt::LinkAction:
+        linkUrls(urls, destination);
+        break;
 
 
-        default:
-            break;
+    default:
+        break;
     }
 }
 
     }
 }
 
@@ -215,7 +209,7 @@ void DolphinMainWindow::refreshViews()
     const bool isPrimaryViewActive = (m_activeView == m_view[PrimaryIdx]);
     KUrl url;
     for (int i = PrimaryIdx; i <= SecondaryIdx; ++i) {
     const bool isPrimaryViewActive = (m_activeView == m_view[PrimaryIdx]);
     KUrl url;
     for (int i = PrimaryIdx; i <= SecondaryIdx; ++i) {
-       if (m_view[i] != 0) {
+        if (m_view[i] != 0) {
             url = m_view[i]->url();
 
             // delete view instance...
             url = m_view[i]->url();
 
             // delete view instance...
@@ -285,26 +279,26 @@ void DolphinMainWindow::slotSortingChanged(DolphinView::Sorting sorting)
 {
     QAction* action = 0;
     switch (sorting) {
 {
     QAction* action = 0;
     switch (sorting) {
-        case DolphinView::SortByName:
-            action = actionCollection()->action("by_name");
-            break;
-        case DolphinView::SortBySize:
-            action = actionCollection()->action("by_size");
-            break;
-        case DolphinView::SortByDate:
-            action = actionCollection()->action("by_date");
-            break;
-        case DolphinView::SortByPermissions:
-            action = actionCollection()->action("by_permissions");
-            break;
-        case DolphinView::SortByOwner:
-            action = actionCollection()->action("by_owner");
-            break;
-        case DolphinView::SortByGroup:
-            action = actionCollection()->action("by_group");
-            break;
-        default:
-            break;
+    case DolphinView::SortByName:
+        action = actionCollection()->action("by_name");
+        break;
+    case DolphinView::SortBySize:
+        action = actionCollection()->action("by_size");
+        break;
+    case DolphinView::SortByDate:
+        action = actionCollection()->action("by_date");
+        break;
+    case DolphinView::SortByPermissions:
+        action = actionCollection()->action("by_permissions");
+        break;
+    case DolphinView::SortByOwner:
+        action = actionCollection()->action("by_owner");
+        break;
+    case DolphinView::SortByGroup:
+        action = actionCollection()->action("by_group");
+        break;
+    default:
+        break;
     }
 
     if (action != 0) {
     }
 
     if (action != 0) {
@@ -324,19 +318,19 @@ void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::AdditionalI
 {
     QAction* action = 0;
     switch (info) {
 {
     QAction* action = 0;
     switch (info) {
-        case KFileItemDelegate::FriendlyMimeType:
-            action = actionCollection()->action("show_mime_info");
-            break;
-        case KFileItemDelegate::Size:
-            action = actionCollection()->action("show_size_info");
-            break;
-        case KFileItemDelegate::ModificationTime:
-            action = actionCollection()->action("show_date_info");
-            break;
-        case KFileItemDelegate::NoInformation:
-        default:
-            action = actionCollection()->action("clear_info");
-            break;
+    case KFileItemDelegate::FriendlyMimeType:
+        action = actionCollection()->action("show_mime_info");
+        break;
+    case KFileItemDelegate::Size:
+        action = actionCollection()->action("show_size_info");
+        break;
+    case KFileItemDelegate::ModificationTime:
+        action = actionCollection()->action("show_date_info");
+        break;
+    case KFileItemDelegate::NoInformation:
+    default:
+        action = actionCollection()->action("clear_info");
+        break;
     }
 
     if (action != 0) {
     }
 
     if (action != 0) {
@@ -430,8 +424,7 @@ void DolphinMainWindow::readProperties(KConfig* config)
         }
         m_view[SecondaryIdx]->setUrl(secondaryView.readEntry("Url"));
         m_view[SecondaryIdx]->setUrlEditable(secondaryView.readEntry("Editable Url", false));
         }
         m_view[SecondaryIdx]->setUrl(secondaryView.readEntry("Url"));
         m_view[SecondaryIdx]->setUrlEditable(secondaryView.readEntry("Editable Url", false));
-    }
-    else if (m_view[SecondaryIdx] != 0) {
+    } else if (m_view[SecondaryIdx] != 0) {
         toggleSplitView();
     }
 }
         toggleSplitView();
     }
 }
@@ -462,9 +455,9 @@ void DolphinMainWindow::deleteItems()
 
     const KUrl::List list = m_activeView->selectedUrls();
     const bool del = KonqOperations::askDeleteConfirmation(list,
 
     const KUrl::List list = m_activeView->selectedUrls();
     const bool del = KonqOperations::askDeleteConfirmation(list,
-                                                           KonqOperations::DEL,
-                                                           KonqOperations::DEFAULT_CONFIRMATION,
-                                                           this);
+                     KonqOperations::DEL,
+                     KonqOperations::DEFAULT_CONFIRMATION,
+                     this);
 
     if (del) {
         KIO::Job* job = KIO::del(list);
 
     if (del) {
         KIO::Job* job = KIO::del(list);
@@ -515,34 +508,34 @@ void DolphinMainWindow::slotUndoAvailable(bool available)
         const KonqUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
         DolphinStatusBar* statusBar = m_activeView->statusBar();
         switch (command) {
         const KonqUndoManager::CommandType command = m_undoCommandTypes.takeFirst();
         DolphinStatusBar* statusBar = m_activeView->statusBar();
         switch (command) {
-            case KonqUndoManager::COPY:
-                statusBar->setMessage(i18n("Copy operation completed."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-            case KonqUndoManager::MOVE:
-                statusBar->setMessage(i18n("Move operation completed."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-            case KonqUndoManager::LINK:
-                statusBar->setMessage(i18n("Link operation completed."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-            case KonqUndoManager::TRASH:
-                statusBar->setMessage(i18n("Move to trash operation completed."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-            case KonqUndoManager::RENAME:
-                statusBar->setMessage(i18n("Renaming operation completed."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-
-            case KonqUndoManager::MKDIR:
-                statusBar->setMessage(i18n("Created directory."),
-                                      DolphinStatusBar::OperationCompleted);
-                break;
-
-            default:
-                break;
+        case KonqUndoManager::COPY:
+            statusBar->setMessage(i18n("Copy operation completed."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+        case KonqUndoManager::MOVE:
+            statusBar->setMessage(i18n("Move operation completed."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+        case KonqUndoManager::LINK:
+            statusBar->setMessage(i18n("Link operation completed."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+        case KonqUndoManager::TRASH:
+            statusBar->setMessage(i18n("Move to trash operation completed."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+        case KonqUndoManager::RENAME:
+            statusBar->setMessage(i18n("Renaming operation completed."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+
+        case KonqUndoManager::MKDIR:
+            statusBar->setMessage(i18n("Created directory."),
+                                  DolphinStatusBar::OperationCompleted);
+            break;
+
+        default:
+            break;
         }
 
     }
         }
 
     }
@@ -610,8 +603,7 @@ void DolphinMainWindow::paste()
     if (KonqMimeData::decodeIsCutSelection(mimeData)) {
         moveUrls(sourceUrls, destUrl);
         clipboard->clear();
     if (KonqMimeData::decodeIsCutSelection(mimeData)) {
         moveUrls(sourceUrls, destUrl);
         clipboard->clear();
-    }
-    else {
+    } else {
         copyUrls(sourceUrls, destUrl);
     }
 }
         copyUrls(sourceUrls, destUrl);
     }
 }
@@ -632,8 +624,7 @@ void DolphinMainWindow::updatePasteAction()
         pasteAction->setEnabled(true);
 
         pasteAction->setText(i18np("Paste One File", "Paste %1 Files", urls.count()));
         pasteAction->setEnabled(true);
 
         pasteAction->setText(i18np("Paste One File", "Paste %1 Files", urls.count()));
-    }
-    else {
+    } else {
         pasteAction->setEnabled(false);
         pasteAction->setText(i18n("Paste"));
     }
         pasteAction->setEnabled(false);
         pasteAction->setText(i18n("Paste"));
     }
@@ -645,8 +636,7 @@ void DolphinMainWindow::updatePasteAction()
             // pasting should not be allowed when more than one file
             // is selected
             pasteAction->setEnabled(false);
             // pasting should not be allowed when more than one file
             // is selected
             pasteAction->setEnabled(false);
-        }
-        else if (count == 1) {
+        } else if (count == 1) {
             // Only one file is selected. Pasting is only allowed if this
             // file is a directory.
             // TODO: this doesn't work with remote protocols; instead we need a
             // Only one file is selected. Pasting is only allowed if this
             // file is a directory.
             // TODO: this doesn't work with remote protocols; instead we need a
@@ -762,16 +752,14 @@ void DolphinMainWindow::toggleSplitView()
         m_splitter->setSizes(QList<int>() << newWidth << newWidth);
         m_view[SecondaryIdx]->reload();
         m_view[SecondaryIdx]->show();
         m_splitter->setSizes(QList<int>() << newWidth << newWidth);
         m_view[SecondaryIdx]->reload();
         m_view[SecondaryIdx]->show();
-    }
-    else {
+    } else {
         // remove secondary view
         if (m_activeView == m_view[PrimaryIdx]) {
             m_view[SecondaryIdx]->close();
             m_view[SecondaryIdx]->deleteLater();
             m_view[SecondaryIdx] = 0;
             setActiveView(m_view[PrimaryIdx]);
         // remove secondary view
         if (m_activeView == m_view[PrimaryIdx]) {
             m_view[SecondaryIdx]->close();
             m_view[SecondaryIdx]->deleteLater();
             m_view[SecondaryIdx] = 0;
             setActiveView(m_view[PrimaryIdx]);
-        }
-        else {
+        } else {
             // The secondary view is active, hence from the users point of view
             // the content of the secondary view should be moved to the primary view.
             // From an implementation point of view it is more efficient to close
             // The secondary view is active, hence from the users point of view
             // the content of the secondary view should be moved to the primary view.
             // From an implementation point of view it is more efficient to close
@@ -793,8 +781,7 @@ void DolphinMainWindow::reloadView()
 }
 
 void DolphinMainWindow::stopLoading()
 }
 
 void DolphinMainWindow::stopLoading()
-{
-}
+{}
 
 void DolphinMainWindow::togglePreview()
 {
 
 void DolphinMainWindow::togglePreview()
 {
@@ -911,35 +898,35 @@ void DolphinMainWindow::compareFiles()
     KUrl::List urls = m_view[PrimaryIdx]->selectedUrls();
 
     switch (urls.count()) {
     KUrl::List urls = m_view[PrimaryIdx]->selectedUrls();
 
     switch (urls.count()) {
-        case 0: {
-            Q_ASSERT(m_view[SecondaryIdx] != 0);
-            urls = m_view[SecondaryIdx]->selectedUrls();
-            Q_ASSERT(urls.count() == 2);
-            urlA = urls[0];
-            urlB = urls[1];
-            break;
-        }
+    case 0: {
+        Q_ASSERT(m_view[SecondaryIdx] != 0);
+        urls = m_view[SecondaryIdx]->selectedUrls();
+        Q_ASSERT(urls.count() == 2);
+        urlA = urls[0];
+        urlB = urls[1];
+        break;
+    }
 
 
-        case 1: {
-            urlA = urls[0];
-            Q_ASSERT(m_view[SecondaryIdx] != 0);
-            urls = m_view[SecondaryIdx]->selectedUrls();
-            Q_ASSERT(urls.count() == 1);
-            urlB = urls[0];
-            break;
-        }
+    case 1: {
+        urlA = urls[0];
+        Q_ASSERT(m_view[SecondaryIdx] != 0);
+        urls = m_view[SecondaryIdx]->selectedUrls();
+        Q_ASSERT(urls.count() == 1);
+        urlB = urls[0];
+        break;
+    }
 
 
-        case 2: {
-            urlA = urls[0];
-            urlB = urls[1];
-            break;
-        }
+    case 2: {
+        urlA = urls[0];
+        urlB = urls[1];
+        break;
+    }
 
 
-        default: {
-            // may not happen: compareFiles may only get invoked if 2
-            // files are selected
-            Q_ASSERT(false);
-        }
+    default: {
+        // may not happen: compareFiles may only get invoked if 2
+        // files are selected
+        Q_ASSERT(false);
+    }
     }
 
     QString command("kompare -c \"");
     }
 
     QString command("kompare -c \"");
@@ -993,7 +980,7 @@ void DolphinMainWindow::init()
     setCentralWidget(m_splitter);
     setupDockWidgets();
 
     setCentralWidget(m_splitter);
     setupDockWidgets();
 
-    setupGUI(Keys|Save|Create|ToolBar);
+    setupGUI(Keys | Save | Create | ToolBar);
     createGUI();
 
     stateChanged("new_file");
     createGUI();
 
     stateChanged("new_file");
@@ -1011,10 +998,10 @@ void DolphinMainWindow::init()
         // assure a proper default size if Dolphin runs the first time
         resize(640, 480);
     }
         // assure a proper default size if Dolphin runs the first time
         resize(640, 480);
     }
-    #ifdef HAVE_KMETADATA
-    if ( !MetaDataWidget::metaDataAvailable() )
+#ifdef HAVE_KMETADATA
+    if (!MetaDataWidget::metaDataAvailable())
         activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);
         activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);
-    #endif
+#endif
 
     emit urlChanged(homeUrl);
 }
 
     emit urlChanged(homeUrl);
 }
@@ -1104,12 +1091,12 @@ void DolphinMainWindow::setupActions()
 
     // setup 'View' menu
     KStandardAction::zoomIn(this,
 
     // setup 'View' menu
     KStandardAction::zoomIn(this,
-                       SLOT(zoomIn()),
-                       actionCollection());
+                            SLOT(zoomIn()),
+                            actionCollection());
 
     KStandardAction::zoomOut(this,
 
     KStandardAction::zoomOut(this,
-                        SLOT(zoomOut()),
-                        actionCollection());
+                             SLOT(zoomOut()),
+                             actionCollection());
 
     KToggleAction* iconsView = actionCollection()->add<KToggleAction>("icons");
     iconsView->setText(i18n("Icons"));
 
     KToggleAction* iconsView = actionCollection()->add<KToggleAction>("icons");
     iconsView->setText(i18n("Icons"));
@@ -1342,8 +1329,7 @@ void DolphinMainWindow::updateEditActions()
     const KFileItemList list = m_activeView->selectedItems();
     if (list.isEmpty()) {
         stateChanged("has_no_selection");
     const KFileItemList list = m_activeView->selectedItems();
     if (list.isEmpty()) {
         stateChanged("has_no_selection");
-    }
-    else {
+    } else {
         stateChanged("has_selection");
 
         QAction* renameAction = actionCollection()->action("rename");
         stateChanged("has_selection");
 
         QAction* renameAction = actionCollection()->action("rename");
@@ -1385,17 +1371,17 @@ void DolphinMainWindow::updateViewActions()
 
     QAction* action = 0;
     switch (m_activeView->mode()) {
 
     QAction* action = 0;
     switch (m_activeView->mode()) {
-        case DolphinView::IconsView:
-            action = actionCollection()->action("icons");
-            break;
-        case DolphinView::DetailsView:
-            action = actionCollection()->action("details");
-            break;
-        case DolphinView::ColumnView:
-            action = actionCollection()->action("columns");
-            break;
-        default:
-            break;
+    case DolphinView::IconsView:
+        action = actionCollection()->action("icons");
+        break;
+    case DolphinView::DetailsView:
+        action = actionCollection()->action("details");
+        break;
+    case DolphinView::ColumnView:
+        action = actionCollection()->action("columns");
+        break;
+    default:
+        break;
     }
 
     if (action != 0) {
     }
 
     if (action != 0) {
@@ -1491,25 +1477,24 @@ void DolphinMainWindow::connectSidebarPage(SidebarPage* page)
             this, SLOT(changeUrl(KUrl)));
     connect(page, SIGNAL(changeSelection(KFileItemList)),
             this, SLOT(changeSelection(KFileItemList)));
             this, SLOT(changeUrl(KUrl)));
     connect(page, SIGNAL(changeSelection(KFileItemList)),
             this, SLOT(changeSelection(KFileItemList)));
-    connect(page, SIGNAL(urlsDropped(KUrl::List,KUrl)),
-            this, SLOT(dropUrls(KUrl::List,KUrl)));
+    connect(page, SIGNAL(urlsDropped(KUrl::List, KUrl)),
+            this, SLOT(dropUrls(KUrl::List, KUrl)));
 
     connect(this, SIGNAL(urlChanged(KUrl)),
             page, SLOT(setUrl(KUrl)));
 
     connect(this, SIGNAL(urlChanged(KUrl)),
             page, SLOT(setUrl(KUrl)));
-     connect(this, SIGNAL(selectionChanged(KFileItemList)),
-             page, SLOT(setSelection(KFileItemList)));
+    connect(this, SIGNAL(selectionChanged(KFileItemList)),
+            page, SLOT(setSelection(KFileItemList)));
 }
 
 DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) :
 }
 
 DolphinMainWindow::UndoUiInterface::UndoUiInterface(DolphinMainWindow* mainWin) :
-    KonqUndoManager::UiInterface(mainWin),
-    m_mainWin(mainWin)
+        KonqUndoManager::UiInterface(mainWin),
+        m_mainWin(mainWin)
 {
     Q_ASSERT(m_mainWin != 0);
 }
 
 DolphinMainWindow::UndoUiInterface::~UndoUiInterface()
 {
     Q_ASSERT(m_mainWin != 0);
 }
 
 DolphinMainWindow::UndoUiInterface::~UndoUiInterface()
-{
-}
+{}
 
 void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
 {
 
 void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job)
 {
index c6b46817f2bc5edc8f460cdd136e1ccf4edf1ee0..4212a0987564c99b6c806c125146ce7d076d8e89 100644 (file)
@@ -51,19 +51,22 @@ class DolphinMainWindow: public KMainWindow
 public:
     virtual ~DolphinMainWindow();
 
 public:
     virtual ~DolphinMainWindow();
 
-       /**
-     * Activates the given view, which means that
-     * all menu actions are applied to this view. When
-     * having a split view setup the nonactive view
-     * is usually shown in darker colors.
-     */
+    /**
+        * Activates the given view, which means that
+        * all menu actions are applied to this view. When
+        * having a split view setup the nonactive view
+        * is usually shown in darker colors.
+        */
     void setActiveView(DolphinView* view);
 
     /**
      * Returns the currently active view. See
      * DolphinMainWindow::setActiveView() for more details.
      */
     void setActiveView(DolphinView* view);
 
     /**
      * Returns the currently active view. See
      * DolphinMainWindow::setActiveView() for more details.
      */
-    DolphinView* activeView() const { return m_activeView; }
+    DolphinView* activeView() const
+    {
+        return m_activeView;
+    }
 
     /** Renames the item represented by \a oldUrl to \a newUrl. */
     void rename(const KUrl& oldUrl, const KUrl& newUrl);
 
     /** Renames the item represented by \a oldUrl to \a newUrl. */
     void rename(const KUrl& oldUrl, const KUrl& newUrl);
@@ -78,7 +81,10 @@ public:
      * Returns the 'Create New...' sub menu which also can be shared
      * with other menus (e. g. a context menu).
      */
      * Returns the 'Create New...' sub menu which also can be shared
      * with other menus (e. g. a context menu).
      */
-    KNewMenu* newMenu() const { return m_newMenu; }
+    KNewMenu* newMenu() const
+    {
+        return m_newMenu;
+    }
 
 public slots:
     /**
 
 public slots:
     /**
@@ -98,7 +104,10 @@ public slots:
     /**
      * Returns the main window ID used through DBus.
      */
     /**
      * Returns the main window ID used through DBus.
      */
-    int getId() const { return m_id; }
+    int getId() const
+    {
+        return m_id;
+    }
 
     /**
      * Inform all affected dolphin components (sidebars, views) of an URL
 
     /**
      * Inform all affected dolphin components (sidebars, views) of an URL
@@ -425,7 +434,7 @@ private:
      * assures that all errors are shown in the status bar of Dolphin
      * instead as modal error dialog with an OK button.
      */
      * assures that all errors are shown in the status bar of Dolphin
      * instead as modal error dialog with an OK button.
      */
-    class UndoUiInterface : public KonqUndoManager::UiInterface
+class UndoUiInterface : public KonqUndoManager::UiInterface
     {
     public:
         UndoUiInterface(DolphinMainWindow* mainWin);
     {
     public:
         UndoUiInterface(DolphinMainWindow* mainWin);
index 8592c30ad0e8b568b401de6bef58fa49d77e600f..b78c109cb77f58b1e6df2467e287280bda593df8 100644 (file)
 #include <kio/job.h>
 
 DolphinNewMenu::DolphinNewMenu(DolphinMainWindow* mainWin) :
 #include <kio/job.h>
 
 DolphinNewMenu::DolphinNewMenu(DolphinMainWindow* mainWin) :
-    KNewMenu(mainWin->actionCollection(), mainWin, "create_new"),
-    m_mainWin(mainWin)
-{
-}
+        KNewMenu(mainWin->actionCollection(), mainWin, "create_new"),
+        m_mainWin(mainWin)
+{}
 
 DolphinNewMenu::~DolphinNewMenu()
 
 DolphinNewMenu::~DolphinNewMenu()
-{
-}
+{}
 
 void DolphinNewMenu::slotResult(KJob* job)
 {
     if (job->error()) {
         DolphinStatusBar* statusBar = m_mainWin->activeView()->statusBar();
         statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
 
 void DolphinNewMenu::slotResult(KJob* job)
 {
     if (job->error()) {
         DolphinStatusBar* statusBar = m_mainWin->activeView()->statusBar();
         statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
-    }
-    else {
+    } else {
         KNewMenu::slotResult(job);
     }
 }
         KNewMenu::slotResult(job);
     }
 }
index 978c1ce59eed9023f53378af958a6951d32ee61b..8db07548f47742b51a5cc59ef58422ec88088b56 100644 (file)
@@ -36,7 +36,7 @@ class KJob;
  */
 class DolphinNewMenu : public KNewMenu
 {
  */
 class DolphinNewMenu : public KNewMenu
 {
-Q_OBJECT
+    Q_OBJECT
 
 public:
     DolphinNewMenu(DolphinMainWindow* mainWin);
 
 public:
     DolphinNewMenu(DolphinMainWindow* mainWin);
index 202ce1db73902a3c3e68ae1372d20afaf2ec8f6a..327e4defc8ec9101f6faf0907417e32653165add 100644 (file)
@@ -40,15 +40,31 @@ class KFilePlacesModel;
  * - bookmarks
  * - properties for icons and details view
  */
  * - bookmarks
  * - properties for icons and details view
  */
-class LIBDOLPHINPRIVATE_EXPORT DolphinSettings {
+class LIBDOLPHINPRIVATE_EXPORT DolphinSettings
+{
 public:
     static DolphinSettings& instance();
 
 public:
     static DolphinSettings& instance();
 
-    GeneralSettings* generalSettings() const { return m_generalSettings; }
-    IconsModeSettings* iconsModeSettings() const { return m_iconsModeSettings; }
-    DetailsModeSettings* detailsModeSettings() const { return m_detailsModeSettings; }
-    ColumnModeSettings* columnModeSettings() const { return m_columnModeSettings; }
-    KFilePlacesModel* placesModel() const { return m_placesModel; }
+    GeneralSettings* generalSettings() const
+    {
+        return m_generalSettings;
+    }
+    IconsModeSettings* iconsModeSettings() const
+    {
+        return m_iconsModeSettings;
+    }
+    DetailsModeSettings* detailsModeSettings() const
+    {
+        return m_detailsModeSettings;
+    }
+    ColumnModeSettings* columnModeSettings() const
+    {
+        return m_columnModeSettings;
+    }
+    KFilePlacesModel* placesModel() const
+    {
+        return m_placesModel;
+    }
 
     /** @see DolphinSettingsBase::save */
     virtual void save();
 
     /** @see DolphinSettingsBase::save */
     virtual void save();
index 53579f5ad20e43f36ff9a5df2866a5e979ded285..909fd6f28a9184f71239615bf63543d3d6e7fed8 100644 (file)
 #include <QFrame>
 
 DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) :
 #include <QFrame>
 
 DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) :
-    KPageDialog(),
-    m_mainWindow(mainWindow)
+        KPageDialog(),
+        m_mainWindow(mainWindow)
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(512, minSize.height()));
 
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(512, minSize.height()));
 
-    setFaceType( List);
+    setFaceType(List);
     setCaption(i18n("Dolphin Preferences"));
     setCaption(i18n("Dolphin Preferences"));
-    setButtons(Ok|Apply|Cancel);
+    setButtons(Ok | Apply | Cancel);
     setDefaultButton(Ok);
 
     m_generalSettingsPage = new GeneralSettingsPage(mainWindow, this);
     setDefaultButton(Ok);
 
     m_generalSettingsPage = new GeneralSettingsPage(mainWindow, this);
@@ -50,12 +50,11 @@ DolphinSettingsDialog::DolphinSettingsDialog(DolphinMainWindow* mainWindow) :
 }
 
 DolphinSettingsDialog::~DolphinSettingsDialog()
 }
 
 DolphinSettingsDialog::~DolphinSettingsDialog()
-{
-}
+{}
 
 void DolphinSettingsDialog::slotButtonClicked(int button)
 {
 
 void DolphinSettingsDialog::slotButtonClicked(int button)
 {
-    if (button==Ok || button==Apply) {
+    if (button == Ok || button == Apply) {
         applySettings();
     }
     KPageDialog::slotButtonClicked(button);
         applySettings();
     }
     KPageDialog::slotButtonClicked(button);
index 3854d2dcdb9883415900028cb72e64871621f72b..95150dab8900e96c40ba1314fdede27f965191c3 100644 (file)
@@ -34,7 +34,8 @@ class DolphinMainWindow;
  *
  * @author Peter Penz <peter.penz@gmx.at>
  */
  *
  * @author Peter Penz <peter.penz@gmx.at>
  */
-class DolphinSettingsDialog : public KPageDialog {
+class DolphinSettingsDialog : public KPageDialog
+{
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
index e42843cb43c9ffd73e868f48b9afe37bc486f0f9..aba4117e8afca9aa0b1e58255f4be9754bc6e141 100644 (file)
 #include <kfileitem.h>
 
 static const int dolphinMapSize = 6;
 #include <kfileitem.h>
 
 static const int dolphinMapSize = 6;
-static int dolphinViewToDirModelColumn[] = {
-    KDirModel::Name,         // DolphinView::SortByName
-    KDirModel::Size,         // DolphinView::SortBySize
-    KDirModel::ModifiedTime, // DolphinView::SortByDate
-    KDirModel::Permissions,  // DolphinView::SortByPermissions
-    KDirModel::Owner,        // DolphinView::SortByOwner
-    KDirModel::Group         // DolphinView::SortByGroup
-};
-
-static DolphinView::Sorting dirModelColumnToDolphinView[] = {
-    DolphinView::SortByName,        // KDirModel::Name
-    DolphinView::SortBySize,        // KDirModel::Size
-    DolphinView::SortByDate,        // KDirModel::ModifiedTime
-    DolphinView::SortByPermissions, // KDirModel::Permissions
-    DolphinView::SortByOwner,       // KDirModel::Owner
-    DolphinView::SortByGroup        // KDirModel::Group
-};
+static int dolphinViewToDirModelColumn[] =
+    {
+        KDirModel::Name,         // DolphinView::SortByName
+        KDirModel::Size,         // DolphinView::SortBySize
+        KDirModel::ModifiedTime, // DolphinView::SortByDate
+        KDirModel::Permissions,  // DolphinView::SortByPermissions
+        KDirModel::Owner,        // DolphinView::SortByOwner
+        KDirModel::Group         // DolphinView::SortByGroup
+    };
+
+static DolphinView::Sorting dirModelColumnToDolphinView[] =
+    {
+        DolphinView::SortByName,        // KDirModel::Name
+        DolphinView::SortBySize,        // KDirModel::Size
+        DolphinView::SortByDate,        // KDirModel::ModifiedTime
+        DolphinView::SortByPermissions, // KDirModel::Permissions
+        DolphinView::SortByOwner,       // KDirModel::Owner
+        DolphinView::SortByGroup        // KDirModel::Group
+    };
 
 
 DolphinSortFilterProxyModel::DolphinSortFilterProxyModel(QObject* parent) :
 
 
 DolphinSortFilterProxyModel::DolphinSortFilterProxyModel(QObject* parent) :
-    QSortFilterProxyModel(parent),
-    m_sortColumn(0),
-    m_sorting(DolphinView::SortByName),
-    m_sortOrder(Qt::AscendingOrder)
+        QSortFilterProxyModel(parent),
+        m_sortColumn(0),
+        m_sorting(DolphinView::SortByName),
+        m_sortOrder(Qt::AscendingOrder)
 {
     setDynamicSortFilter(true);
 
 {
     setDynamicSortFilter(true);
 
@@ -59,8 +61,7 @@ DolphinSortFilterProxyModel::DolphinSortFilterProxyModel(QObject* parent) :
 }
 
 DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
 }
 
 DolphinSortFilterProxyModel::~DolphinSortFilterProxyModel()
-{
-}
+{}
 
 void DolphinSortFilterProxyModel::setSorting(DolphinView::Sorting sorting)
 {
 
 void DolphinSortFilterProxyModel::setSorting(DolphinView::Sorting sorting)
 {
@@ -108,7 +109,7 @@ DolphinView::Sorting DolphinSortFilterProxyModel::sortingForColumn(int column)
 }
 
 bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left,
 }
 
 bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left,
-                                           const QModelIndex& right) const
+        const QModelIndex& right) const
 {
     KDirModel* dirModel = static_cast<KDirModel*>(sourceModel());
 
 {
     KDirModel* dirModel = static_cast<KDirModel*>(sourceModel());
 
@@ -134,7 +135,7 @@ bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left,
         const QString rightStr = rightData.toString();
 
         return sortCaseSensitivity() ? (naturalCompare(leftStr, rightStr) < 0) :
         const QString rightStr = rightData.toString();
 
         return sortCaseSensitivity() ? (naturalCompare(leftStr, rightStr) < 0) :
-                                       (naturalCompare(leftStr.toLower(), rightStr.toLower()) < 0);
+               (naturalCompare(leftStr.toLower(), rightStr.toLower()) < 0);
     }
 
     // We have set a SortRole and trust the ProxyModel to do
     }
 
     // We have set a SortRole and trust the ProxyModel to do
@@ -143,7 +144,7 @@ bool DolphinSortFilterProxyModel::lessThan(const QModelIndex& left,
 }
 
 int DolphinSortFilterProxyModel::naturalCompare(const QString& a,
 }
 
 int DolphinSortFilterProxyModel::naturalCompare(const QString& a,
-                                                const QString& b)
+        const QString& b)
 {
     // This method chops the input a and b into pieces of
     // digits and non-digits (a1.05 becomes a | 1 | . | 05)
 {
     // This method chops the input a and b into pieces of
     // digits and non-digits (a1.05 becomes a | 1 | . | 05)
@@ -193,24 +194,19 @@ int DolphinSortFilterProxyModel::naturalCompare(const QString& a,
             while (1) {
                 if (!currA->isDigit() && !currB->isDigit()) {
                     break;
             while (1) {
                 if (!currA->isDigit() && !currB->isDigit()) {
                     break;
-                }
-                else if (!currA->isDigit()) {
+                } else if (!currA->isDigit()) {
                     return -1;
                     return -1;
-                }
-                else if (!currB->isDigit()) {
-                    return +1;
-                }
-                else if (*currA < *currB ) {
+                } else if (!currB->isDigit()) {
+                    return + 1;
+                } else if (*currA < *currB) {
                     return -1;
                     return -1;
-                }
-                else if (*currA > *currB) {
-                    return +1;
+                } else if (*currA > *currB) {
+                    return + 1;
                 }
                 ++currA;
                 ++currB;
             }
                 }
                 ++currA;
                 ++currB;
             }
-        }
-        else {
+        } else {
             // No digit-sequence starts with 0 -> assume we are looking at some integer
             // do right aligned comparison.
             //
             // No digit-sequence starts with 0 -> assume we are looking at some integer
             // do right aligned comparison.
             //
@@ -225,18 +221,14 @@ int DolphinSortFilterProxyModel::naturalCompare(const QString& a,
                         return weight;
                     }
                     break;
                         return weight;
                     }
                     break;
-                }
-                else if (!currA->isDigit()) {
+                } else if (!currA->isDigit()) {
                     return -1;
                     return -1;
-                }
-                else if (!currB->isDigit()) {
-                    return +1;
-                }
-                else if ((*currA < *currB) && (weight == 0)) {
+                } else if (!currB->isDigit()) {
+                    return + 1;
+                } else if ((*currA < *currB) && (weight == 0)) {
                     weight = -1;
                     weight = -1;
-                }
-                else if ((*currA > *currB) && (weight == 0)) {
-                    weight = +1;
+                } else if ((*currA > *currB) && (weight == 0)) {
+                    weight = + 1;
                 }
                 ++currA;
                 ++currB;
                 }
                 ++currA;
                 ++currB;
@@ -251,7 +243,7 @@ int DolphinSortFilterProxyModel::naturalCompare(const QString& a,
         return 0;
     }
 
         return 0;
     }
 
-    return currA->isNull() ? -1 : +1;
+    return currA->isNull() ? -1 : + 1;
 }
 
 #include "dolphinsortfilterproxymodel.moc"
 }
 
 #include "dolphinsortfilterproxymodel.moc"
index 2db8ee26730f92b9a034e22a6356e720ea05c141..e7fc781828f65bd50358b02db4c574f7467afa53 100644 (file)
@@ -48,10 +48,16 @@ public:
     virtual ~DolphinSortFilterProxyModel();
 
     void setSorting(DolphinView::Sorting sorting);
     virtual ~DolphinSortFilterProxyModel();
 
     void setSorting(DolphinView::Sorting sorting);
-    DolphinView::Sorting sorting() const { return m_sorting; }
+    DolphinView::Sorting sorting() const
+    {
+        return m_sorting;
+    }
 
     void setSortOrder(Qt::SortOrder sortOrder);
 
     void setSortOrder(Qt::SortOrder sortOrder);
-    Qt::SortOrder sortOrder() const { return m_sortOrder; }
+    Qt::SortOrder sortOrder() const
+    {
+        return m_sortOrder;
+    }
 
     /**
      * @reimplemented, @internal
 
     /**
      * @reimplemented, @internal
index f908a24cd733136d93f915651365a1fc8a140ac1..1f6859a8f52040b7fdc705a9824c73bec9994155 100644 (file)
 #include <kvbox.h>
 
 DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
 #include <kvbox.h>
 
 DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
-    KHBox(parent),
-    m_messageLabel(0),
-    m_spaceInfo(0),
-    m_progressBar(0),
-    m_progress(100)
+        KHBox(parent),
+        m_messageLabel(0),
+        m_spaceInfo(0),
+        m_progressBar(0),
+        m_progress(100)
 {
     setSpacing(4);
 
 {
     setSpacing(4);
 
@@ -65,8 +65,7 @@ DolphinStatusBar::DolphinStatusBar(DolphinView* parent) :
 
 
 DolphinStatusBar::~DolphinStatusBar()
 
 
 DolphinStatusBar::~DolphinStatusBar()
-{
-}
+{}
 
 void DolphinStatusBar::setMessage(const QString& msg,
                                   Type type)
 
 void DolphinStatusBar::setMessage(const QString& msg,
                                   Type type)
@@ -105,8 +104,7 @@ void DolphinStatusBar::setProgress(int percent)
 {
     if (percent < 0) {
         percent = 0;
 {
     if (percent < 0) {
         percent = 0;
-    }
-    else if (percent > 100) {
+    } else if (percent > 100) {
         percent = 100;
     }
 
         percent = 100;
     }
 
@@ -126,8 +124,7 @@ void DolphinStatusBar::setProgress(int percent)
     const QString msg(m_messageLabel->text());
     if ((percent == 0) && !msg.isEmpty()) {
         setMessage(QString(), Default);
     const QString msg(m_messageLabel->text());
     if ((percent == 0) && !msg.isEmpty()) {
         setMessage(QString(), Default);
-    }
-    else if ((percent == 100) && (msg != defaultText)) {
+    } else if ((percent == 100) && (msg != defaultText)) {
         setMessage(defaultText, Default);
     }
 }
         setMessage(defaultText, Default);
     }
 }
@@ -163,8 +160,7 @@ void DolphinStatusBar::updateProgressInfo()
             m_progressText->show();
             m_progressBar->show();
         }
             m_progressText->show();
             m_progressBar->show();
         }
-    }
-    else {
+    } else {
         // hide the progress information and show the space information
         m_progressText->hide();
         m_progressBar->hide();
         // hide the progress information and show the space information
         m_progressText->hide();
         m_progressBar->hide();
@@ -191,8 +187,7 @@ void DolphinStatusBar::showSpaceInfo()
         if (isProgressBarVisible || (widthGap > 0)) {
             m_spaceInfo->hide();
         }
         if (isProgressBarVisible || (widthGap > 0)) {
             m_spaceInfo->hide();
         }
-    }
-    else if (widthGap + m_spaceInfo->width() <= 0) {
+    } else if (widthGap + m_spaceInfo->width() <= 0) {
         m_spaceInfo->show();
     }
 }
         m_spaceInfo->show();
     }
 }
index 5a04b21cb8f570a8b2980251e9aedd39f90d00f5..e57288228016a00f1e9937e52595df2d5d611b94 100644 (file)
@@ -37,7 +37,8 @@ class QTimer;
  * The statusbar allows to show messages and progress
  * information.
  */
  * The statusbar allows to show messages and progress
  * information.
  */
-class DolphinStatusBar : public KHBox {
+class DolphinStatusBar : public KHBox
+{
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
@@ -93,7 +94,10 @@ public:
      * operations.
      */
     void setProgress(int percent);
      * operations.
      */
     void setProgress(int percent);
-    int progress() const { return m_progress; }
+    int progress() const
+    {
+        return m_progress;
+    }
 
     /**
      * Clears the message text of the status bar by replacing
 
     /**
      * Clears the message text of the status bar by replacing
index 3b5610f60163bb6eb9faa6f83a7830953d108826..45717afc1b9a439aed9a78c611f40f556702e656 100644 (file)
@@ -63,26 +63,26 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
                          const KUrl& url,
                          Mode mode,
                          bool showHiddenFiles) :
                          const KUrl& url,
                          Mode mode,
                          bool showHiddenFiles) :
-    QWidget(parent),
-    m_showProgress(false),
-    m_blockContentsMovedSignal(false),
-    m_mode(mode),
-    m_iconSize(0),
-    m_folderCount(0),
-    m_fileCount(0),
-    m_mainWindow(mainWindow),
-    m_topLayout(0),
-    m_urlNavigator(0),
-    m_controller(0),
-    m_iconsView(0),
-    m_detailsView(0),
-    m_columnView(0),
-    m_fileItemDelegate(0),
-    m_filterBar(0),
-    m_statusBar(0),
-    m_dirModel(0),
-    m_dirLister(0),
-    m_proxyModel(0)
+        QWidget(parent),
+        m_showProgress(false),
+        m_blockContentsMovedSignal(false),
+        m_mode(mode),
+        m_iconSize(0),
+        m_folderCount(0),
+        m_fileCount(0),
+        m_mainWindow(mainWindow),
+        m_topLayout(0),
+        m_urlNavigator(0),
+        m_controller(0),
+        m_iconsView(0),
+        m_detailsView(0),
+        m_columnView(0),
+        m_fileItemDelegate(0),
+        m_filterBar(0),
+        m_statusBar(0),
+        m_dirModel(0),
+        m_dirLister(0),
+        m_proxyModel(0)
 {
     hide();
     setFocusPolicy(Qt::StrongFocus);
 {
     hide();
     setFocusPolicy(Qt::StrongFocus);
@@ -164,7 +164,7 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
     m_filterBar = new FilterBar(this);
     m_filterBar->hide();
     connect(m_filterBar, SIGNAL(filterChanged(const QString&)),
     m_filterBar = new FilterBar(this);
     m_filterBar->hide();
     connect(m_filterBar, SIGNAL(filterChanged(const QString&)),
-           this, SLOT(changeNameFilter(const QString&)));
+            this, SLOT(changeNameFilter(const QString&)));
     connect(m_filterBar, SIGNAL(closeRequest()),
             this, SLOT(closeFilterBar()));
 
     connect(m_filterBar, SIGNAL(closeRequest()),
             this, SLOT(closeFilterBar()));
 
@@ -271,8 +271,7 @@ void DolphinView::renameSelectedItems()
         if (newName.isEmpty()) {
             view->statusBar()->setMessage(dialog.errorString(),
                                           DolphinStatusBar::Error);
         if (newName.isEmpty()) {
             view->statusBar()->setMessage(dialog.errorString(),
                                           DolphinStatusBar::Error);
-        }
-        else {
+        } else {
             // TODO: check how this can be integrated into KonqUndoManager/KonqOperations
             // as one operation instead of n rename operations like it is done now...
             Q_ASSERT(newName.contains('#'));
             // TODO: check how this can be integrated into KonqUndoManager/KonqOperations
             // as one operation instead of n rename operations like it is done now...
             Q_ASSERT(newName.contains('#'));
@@ -300,8 +299,7 @@ void DolphinView::renameSelectedItems()
                 ++it;
             }
         }
                 ++it;
             }
         }
-    }
-    else {
+    } else {
         // Only one item has been selected for renaming. Use the custom
         // renaming mechanism from the views.
         Q_ASSERT(urls.count() == 1);
         // Only one item has been selected for renaming. Use the custom
         // renaming mechanism from the views.
         Q_ASSERT(urls.count() == 1);
@@ -318,8 +316,7 @@ void DolphinView::renameSelectedItems()
         if (newName.isEmpty()) {
             view->statusBar()->setMessage(dialog.errorString(),
                                           DolphinStatusBar::Error);
         if (newName.isEmpty()) {
             view->statusBar()->setMessage(dialog.errorString(),
                                           DolphinStatusBar::Error);
-        }
-        else {
+        } else {
             const KUrl& oldUrl = urls.first();
             KUrl newUrl = oldUrl;
             newUrl.setFileName(newName);
             const KUrl& oldUrl = urls.first();
             KUrl newUrl = oldUrl;
             newUrl.setFileName(newName);
@@ -360,7 +357,7 @@ void DolphinView::emitRequestItemInfo(const KUrl& url)
 
 bool DolphinView::isFilterBarVisible() const
 {
 
 bool DolphinView::isFilterBarVisible() const
 {
-  return m_filterBar->isVisible();
+    return m_filterBar->isVisible();
 }
 
 bool DolphinView::isUrlEditable() const
 }
 
 bool DolphinView::isUrlEditable() const
@@ -522,8 +519,8 @@ void DolphinView::rename(const KUrl& source, const QString& newName)
     dest.addPath(newName);
 
     const bool destExists = KIO::NetAccess::exists(dest,
     dest.addPath(newName);
 
     const bool destExists = KIO::NetAccess::exists(dest,
-                                                   false,
-                                                   mainWindow()->activeView());
+                            false,
+                            mainWindow()->activeView());
     if (destExists) {
         // the destination already exists, hence ask the user
         // how to proceed...
     if (destExists) {
         // the destination already exists, hence ask the user
         // how to proceed...
@@ -533,25 +530,24 @@ void DolphinView::rename(const KUrl& source, const QString& newName)
                                        dest.path(),
                                        KIO::M_OVERWRITE);
         switch (renameDialog.exec()) {
                                        dest.path(),
                                        KIO::M_OVERWRITE);
         switch (renameDialog.exec()) {
-            case KIO::R_OVERWRITE:
-                // the destination should be overwritten
-                ok = KIO::NetAccess::file_move(source, dest, -1, true);
-                break;
-
-            case KIO::R_RENAME: {
-                // a new name for the destination has been used
-                KUrl newDest(renameDialog.newDestUrl());
-                ok = KIO::NetAccess::file_move(source, newDest);
-                break;
-            }
+        case KIO::R_OVERWRITE:
+            // the destination should be overwritten
+            ok = KIO::NetAccess::file_move(source, dest, -1, true);
+            break;
 
 
-            default:
-                // the renaming operation has been canceled
-                reload();
-                return;
+        case KIO::R_RENAME: {
+            // a new name for the destination has been used
+            KUrl newDest(renameDialog.newDestUrl());
+            ok = KIO::NetAccess::file_move(source, newDest);
+            break;
         }
         }
-    }
-    else {
+
+        default:
+            // the renaming operation has been canceled
+            reload();
+            return;
+        }
+    } else {
         // no destination exists, hence just move the file to
         // do the renaming
         ok = KIO::NetAccess::file_move(source, dest);
         // no destination exists, hence just move the file to
         // do the renaming
         ok = KIO::NetAccess::file_move(source, dest);
@@ -559,13 +555,12 @@ void DolphinView::rename(const KUrl& source, const QString& newName)
 
     const QString destFileName = dest.fileName();
     if (ok) {
 
     const QString destFileName = dest.fileName();
     if (ok) {
-        m_statusBar->setMessage(i18n("Renamed file '%1' to '%2'.",source.fileName(), destFileName),
+        m_statusBar->setMessage(i18n("Renamed file '%1' to '%2'.", source.fileName(), destFileName),
                                 DolphinStatusBar::OperationCompleted);
 
         KonqOperations::rename(this, source, destFileName);
                                 DolphinStatusBar::OperationCompleted);
 
         KonqOperations::rename(this, source, destFileName);
-    }
-    else {
-        m_statusBar->setMessage(i18n("Renaming of file '%1' to '%2' failed.",source.fileName(), destFileName),
+    } else {
+        m_statusBar->setMessage(i18n("Renaming of file '%1' to '%2' failed.", source.fileName(), destFileName),
                                 DolphinStatusBar::Error);
         reload();
     }
                                 DolphinStatusBar::Error);
         reload();
     }
@@ -589,7 +584,7 @@ DolphinMainWindow* DolphinView::mainWindow() const
 
 void DolphinView::loadDirectory(const KUrl& url)
 {
 
 void DolphinView::loadDirectory(const KUrl& url)
 {
-    if(!isActive()) {
+    if (!isActive()) {
         requestActivation();
     }
 
         requestActivation();
     }
 
@@ -675,34 +670,29 @@ void DolphinView::triggerItem(const QModelIndex& index)
     KUrl url;
     if (localPath.isEmpty()) {
         url = item->url();
     KUrl url;
     if (localPath.isEmpty()) {
         url = item->url();
-    }
-    else {
+    } else {
         url = localPath;
     }
 
     if (item->isDir()) {
         setUrl(url);
         url = localPath;
     }
 
     if (item->isDir()) {
         setUrl(url);
-    }
-    else if (item->isFile()) {
+    } else if (item->isFile()) {
         // allow to browse through ZIP and tar files
         KMimeType::Ptr mime = item->mimeTypePtr();
         if (mime->is("application/zip")) {
             url.setProtocol("zip");
             setUrl(url);
         // allow to browse through ZIP and tar files
         KMimeType::Ptr mime = item->mimeTypePtr();
         if (mime->is("application/zip")) {
             url.setProtocol("zip");
             setUrl(url);
-        }
-        else if (mime->is("application/x-tar") ||
-                 mime->is("application/x-tarz") ||
-                 mime->is("application/x-bzip-compressed-tar") ||
-                 mime->is("application/x-compressed-tar") ||
-                 mime->is("application/x-tzo")) {
+        } else if (mime->is("application/x-tar") ||
+                   mime->is("application/x-tarz") ||
+                   mime->is("application/x-bzip-compressed-tar") ||
+                   mime->is("application/x-compressed-tar") ||
+                   mime->is("application/x-tzo")) {
             url.setProtocol("tar");
             setUrl(url);
             url.setProtocol("tar");
             setUrl(url);
-        }
-        else {
+        } else {
             item->run();
         }
             item->run();
         }
-    }
-    else {
+    } else {
         item->run();
     }
 }
         item->run();
     }
 }
@@ -733,8 +723,7 @@ void DolphinView::updateItemCount()
         KFileItem* item = *it;
         if (item->isDir()) {
             ++m_folderCount;
         KFileItem* item = *it;
         if (item->isDir()) {
             ++m_folderCount;
-        }
-        else {
+        } else {
             ++m_fileCount;
         }
         ++it;
             ++m_fileCount;
         }
         ++it;
@@ -765,8 +754,7 @@ void DolphinView::showPreview(const KFileItem* item, const QPixmap& pixmap)
             KIconEffect iconEffect;
             const QPixmap cutPixmap = iconEffect.apply(pixmap, K3Icon::Desktop, K3Icon::DisabledState);
             m_dirModel->setData(idx, QIcon(cutPixmap), Qt::DecorationRole);
             KIconEffect iconEffect;
             const QPixmap cutPixmap = iconEffect.apply(pixmap, K3Icon::Desktop, K3Icon::DisabledState);
             m_dirModel->setData(idx, QIcon(cutPixmap), Qt::DecorationRole);
-        }
-        else {
+        } else {
             m_dirModel->setData(idx, QIcon(pixmap), Qt::DecorationRole);
         }
     }
             m_dirModel->setData(idx, QIcon(pixmap), Qt::DecorationRole);
         }
     }
@@ -811,9 +799,8 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
         const QString location(url.pathOrUrl());
         if (location.isEmpty()) {
             m_statusBar->setMessage(i18n("The location is empty."), DolphinStatusBar::Error);
         const QString location(url.pathOrUrl());
         if (location.isEmpty()) {
             m_statusBar->setMessage(i18n("The location is empty."), DolphinStatusBar::Error);
-        }
-        else {
-            m_statusBar->setMessage(i18n("The location '%1' is invalid.",location),
+        } else {
+            m_statusBar->setMessage(i18n("The location '%1' is invalid.", location),
                                     DolphinStatusBar::Error);
         }
         return;
                                     DolphinStatusBar::Error);
         }
         return;
@@ -844,19 +831,17 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
             if (dirListerUrl.isValid()) {
                 const KUrl::List dirs = m_dirLister->directories();
                 KUrl url;
             if (dirListerUrl.isValid()) {
                 const KUrl::List dirs = m_dirLister->directories();
                 KUrl url;
-                foreach (url, dirs) {
+                foreach(url, dirs) {
                     m_dirLister->updateDirectory(url);
                 }
                 openDir = false;
             }
                     m_dirLister->updateDirectory(url);
                 }
                 openDir = false;
             }
-        }
-        else if (m_dirLister->directories().contains(url)) {
+        } else if (m_dirLister->directories().contains(url)) {
             // The dir lister contains the directory already, so
             // KDirLister::openUrl() may not been invoked twice.
             m_dirLister->updateDirectory(url);
             openDir = false;
             // The dir lister contains the directory already, so
             // KDirLister::openUrl() may not been invoked twice.
             m_dirLister->updateDirectory(url);
             openDir = false;
-        }
-        else {
+        } else {
             const KUrl& dirListerUrl = m_dirLister->url();
             if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
                 // The current URL is not a child of the dir lister
             const KUrl& dirListerUrl = m_dirLister->url();
             if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
                 // The current URL is not a child of the dir lister
@@ -895,12 +880,11 @@ QString DolphinView::selectionStatusBarText() const
     KIO::filesize_t byteSize = 0;
     KFileItemList::const_iterator it = list.begin();
     const KFileItemList::const_iterator end = list.end();
     KIO::filesize_t byteSize = 0;
     KFileItemList::const_iterator it = list.begin();
     const KFileItemList::const_iterator end = list.end();
-    while (it != end){
+    while (it != end) {
         KFileItem* item = *it;
         if (item->isDir()) {
             ++folderCount;
         KFileItem* item = *it;
         if (item->isDir()) {
             ++folderCount;
-        }
-        else {
+        } else {
             ++fileCount;
             byteSize += item->size();
         }
             ++fileCount;
             byteSize += item->size();
         }
@@ -927,8 +911,7 @@ void DolphinView::showFilterBar(bool show)
     Q_ASSERT(m_filterBar != 0);
     if (show) {
         m_filterBar->show();
     Q_ASSERT(m_filterBar != 0);
     if (show) {
         m_filterBar->show();
-    }
-    else {
+    } else {
         m_filterBar->hide();
     }
 }
         m_filterBar->hide();
     }
 }
@@ -970,7 +953,7 @@ void DolphinView::changeSelection(const KFileItemList& selection)
     KUrl baseUrl = url();
     KUrl url;
     QItemSelection new_selection;
     KUrl baseUrl = url();
     KUrl url;
     QItemSelection new_selection;
-    foreach (KFileItem* item, selection) {
+    foreach(KFileItem* item, selection) {
         url = item->url().upUrl();
         if (baseUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) {
             QModelIndex index = m_proxyModel->mapFromSource(m_dirModel->indexForItem(*item));
         url = item->url().upUrl();
         if (baseUrl.equals(url, KUrl::CompareWithoutTrailingSlash)) {
             QModelIndex index = m_proxyModel->mapFromSource(m_dirModel->indexForItem(*item));
@@ -1003,7 +986,7 @@ void DolphinView::changeNameFilter(const QString& nameFilter)
     m_dirLister->setNameFilter(adjustedFilter);
     m_dirLister->emitChanges();
 #else
     m_dirLister->setNameFilter(adjustedFilter);
     m_dirLister->emitChanges();
 #else
-    m_proxyModel->setFilterRegExp( nameFilter );
+    m_proxyModel->setFilterRegExp(nameFilter);
 #endif
 }
 
 #endif
 }
 
@@ -1041,7 +1024,7 @@ void DolphinView::dropUrls(const KUrl::List& urls,
     }
 
     const KUrl& destination = (directory == 0) ? url() :
     }
 
     const KUrl& destination = (directory == 0) ? url() :
-                                                 directory->url();
+                              directory->url();
     dropUrls(urls, destination);
 }
 
     dropUrls(urls, destination);
 }
 
@@ -1081,7 +1064,7 @@ void DolphinView::emitContentsMoved()
 void DolphinView::updateActivationState()
 {
     m_urlNavigator->setActive(isActive());
 void DolphinView::updateActivationState()
 {
     m_urlNavigator->setActive(isActive());
-    if(isActive()) {
+    if (isActive()) {
         emit urlChanged(url());
         emit selectionChanged(selectedItems());
     }
         emit urlChanged(url());
         emit selectionChanged(selectedItems());
     }
@@ -1127,20 +1110,20 @@ void DolphinView::createView()
 
     // ... and recreate it representing the current mode
     switch (m_mode) {
 
     // ... and recreate it representing the current mode
     switch (m_mode) {
-        case IconsView:
-            m_iconsView = new DolphinIconsView(this, m_controller);
-            view = m_iconsView;
-            break;
-
-        case DetailsView:
-            m_detailsView = new DolphinDetailsView(this, m_controller);
-            view = m_detailsView;
-            break;
-
-        case ColumnView:
-            m_columnView = new DolphinColumnView(this, m_controller);
-            view = m_columnView;
-            break;
+    case IconsView:
+        m_iconsView = new DolphinIconsView(this, m_controller);
+        view = m_iconsView;
+        break;
+
+    case DetailsView:
+        m_detailsView = new DolphinDetailsView(this, m_controller);
+        view = m_detailsView;
+        break;
+
+    case ColumnView:
+        m_columnView = new DolphinColumnView(this, m_controller);
+        view = m_columnView;
+        break;
     }
 
     Q_ASSERT(view != 0);
     }
 
     Q_ASSERT(view != 0);
@@ -1169,7 +1152,7 @@ void DolphinView::selectAll(QItemSelectionModel::SelectionFlags flags)
 
     const QModelIndex topLeft = itemModel->index(0, 0);
     const QModelIndex bottomRight = itemModel->index(itemModel->rowCount() - 1,
 
     const QModelIndex topLeft = itemModel->index(0, 0);
     const QModelIndex bottomRight = itemModel->index(itemModel->rowCount() - 1,
-                                                     itemModel->columnCount() - 1);
+                                    itemModel->columnCount() - 1);
 
     QItemSelection selection(topLeft, bottomRight);
     selectionModel->select(selection, flags);
 
     QItemSelection selection(topLeft, bottomRight);
     selectionModel->select(selection, flags);
@@ -1179,8 +1162,7 @@ QAbstractItemView* DolphinView::itemView() const
 {
     if (m_detailsView != 0) {
         return m_detailsView;
 {
     if (m_detailsView != 0) {
         return m_detailsView;
-    }
-    else if (m_columnView != 0) {
+    } else if (m_columnView != 0) {
         return m_columnView;
     }
 
         return m_columnView;
     }
 
@@ -1200,7 +1182,7 @@ bool DolphinView::isCutItem(const KFileItem& item) const
     const KUrl& itemUrl = item.url();
     KUrl::List::const_iterator it = cutUrls.begin();
     const KUrl::List::const_iterator end = cutUrls.end();
     const KUrl& itemUrl = item.url();
     KUrl::List::const_iterator it = cutUrls.begin();
     const KUrl::List::const_iterator end = cutUrls.end();
-    while (it != end){
+    while (it != end) {
         if (*it == itemUrl) {
             return true;
         }
         if (*it == itemUrl) {
             return true;
         }
index 2118aaf56b21cba061be8c9c09d257eccec8d041..4f78f050be8bfbc1de98e79346f203251454fbce 100644 (file)
@@ -72,12 +72,12 @@ class DolphinView : public QWidget
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
-       /**
-     * Defines the view mode for a directory. The view mode
-     * can be defined when constructing a DolphinView. The
-     * view mode is automatically updated if the directory itself
-     * defines a view mode (see class ViewProperties for details).
-     */
+    /**
+        * Defines the view mode for a directory. The view mode
+        * can be defined when constructing a DolphinView. The
+        * view mode is automatically updated if the directory itself
+        * defines a view mode (see class ViewProperties for details).
+        */
     enum Mode
     {
         /**
     enum Mode
     {
         /**
@@ -307,7 +307,10 @@ public:
     KFileItemDelegate::AdditionalInformation additionalInfo() const;
 
     /** Returns the KUrlNavigator of the view for read access. */
     KFileItemDelegate::AdditionalInformation additionalInfo() const;
 
     /** Returns the KUrlNavigator of the view for read access. */
-    const KUrlNavigator* urlNavigator() const { return m_urlNavigator; }
+    const KUrlNavigator* urlNavigator() const
+    {
+        return m_urlNavigator;
+    }
 
     /**
      * Triggers to request user information for the item given
 
     /**
      * Triggers to request user information for the item given
@@ -550,14 +553,18 @@ private:
      * requires some special handling for iterating through directories,
      * this method has been introduced for convenience.
      */
      * requires some special handling for iterating through directories,
      * this method has been introduced for convenience.
      */
-    bool isColumnViewActive() const { return m_columnView != 0; }
+    bool isColumnViewActive() const
+    {
+        return m_columnView != 0;
+    }
 
 private:
     /**
      * Remembers the original pixmap for an item before
      * the cut effect is applied.
      */
 
 private:
     /**
      * Remembers the original pixmap for an item before
      * the cut effect is applied.
      */
-    struct CutItem {
+    struct CutItem
+    {
         KUrl url;
         QPixmap pixmap;
     };
         KUrl url;
         QPixmap pixmap;
     };
index f7c582262f85cbc1375bf16dbe5560d24c33bf94..46c28f3c2f2d0774a16b3e741803f02c87c779c1 100644 (file)
@@ -32,7 +32,7 @@
 #include "dolphinmainwindow.h"
 
 FilterBar::FilterBar(QWidget* parent) :
 #include "dolphinmainwindow.h"
 
 FilterBar::FilterBar(QWidget* parent) :
-    QWidget(parent)
+        QWidget(parent)
 {
     const int gap = 3;
 
 {
     const int gap = 3;
 
@@ -65,8 +65,7 @@ FilterBar::FilterBar(QWidget* parent) :
 }
 
 FilterBar::~FilterBar()
 }
 
 FilterBar::~FilterBar()
-{
-}
+{}
 
 void FilterBar::hideEvent(QHideEvent* event)
 {
 
 void FilterBar::hideEvent(QHideEvent* event)
 {
index 2961cf0d6743747398ac2971b0e5a6eb74c2ab18..4a2b6df68249c7e609a004ce1cc7d5eb8b55cbe5 100644 (file)
 
 #include "dolphin_generalsettings.h"
 
 
 #include "dolphin_generalsettings.h"
 
-GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* parent) :
-    SettingsPageBase(parent),
-    m_mainWindow(mainWin),
-    m_homeUrl(0),
-    m_startSplit(0),
-    m_startEditable(0),
-    m_showDeleteCommand(0)
+GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* parent) :
+        SettingsPageBase(parent),
+        m_mainWindow(mainWin),
+        m_homeUrl(0),
+        m_startSplit(0),
+        m_startEditable(0),
+        m_showDeleteCommand(0)
 {
     const int spacing = KDialog::spacingHint();
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
 {
     const int spacing = KDialog::spacingHint();
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
@@ -109,8 +109,7 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par
 
 
 GeneralSettingsPage::~GeneralSettingsPage()
 
 
 GeneralSettingsPage::~GeneralSettingsPage()
-{
-}
+{}
 
 void GeneralSettingsPage::applySettings()
 {
 
 void GeneralSettingsPage::applySettings()
 {
index 4f496246b1d2e5ebaff200819c08834785b07e4e..e35d948b5075ff202509a13bf1b7020f07cd88e6 100644 (file)
 #include <khbox.h>
 
 GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
 #include <khbox.h>
 
 GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
-                                                 QWidget* parent) :
-    KVBox(parent),
-    m_mainWindow(mainWindow),
-    m_localProps(0),
-    m_globalProps(0),
-    m_maxPreviewSize(0)
+        QWidget* parent) :
+        KVBox(parent),
+        m_mainWindow(mainWindow),
+        m_localProps(0),
+        m_globalProps(0),
+        m_maxPreviewSize(0)
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     Q_ASSERT(settings != 0);
 {
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     Q_ASSERT(settings != 0);
@@ -60,8 +60,7 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
     m_globalProps = new QRadioButton(i18n("Use common view properties for all folders"), propsBox);
     if (settings->globalViewProps()) {
         m_globalProps->setChecked(true);
     m_globalProps = new QRadioButton(i18n("Use common view properties for all folders"), propsBox);
     if (settings->globalViewProps()) {
         m_globalProps->setChecked(true);
-    }
-    else {
+    } else {
         m_localProps->setChecked(true);
     }
 
         m_localProps->setChecked(true);
     }
 
@@ -90,8 +89,7 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
     int maxMByteSize = maxByteSize / (1024 * 1024);
     if (maxMByteSize < 1) {
         maxMByteSize = 1;
     int maxMByteSize = maxByteSize / (1024 * 1024);
     if (maxMByteSize < 1) {
         maxMByteSize = 1;
-    }
-    else if (maxMByteSize > max) {
+    } else if (maxMByteSize > max) {
         maxMByteSize = max;
     }
     m_maxPreviewSize->setValue(maxMByteSize);
         maxMByteSize = max;
     }
     m_maxPreviewSize->setValue(maxMByteSize);
@@ -119,8 +117,7 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(DolphinMainWindow* mainWindow,
 
 
 GeneralViewSettingsPage::~GeneralViewSettingsPage()
 
 
 GeneralViewSettingsPage::~GeneralViewSettingsPage()
-{
-}
+{}
 
 void GeneralViewSettingsPage::applySettings()
 {
 
 void GeneralViewSettingsPage::applySettings()
 {
index d7d248819ada3c91615c05dc40def6e71d941763..55256e87cd9831bb7a418d5d7503539c757706b7 100644 (file)
 #include <QVBoxLayout>
 
 IconSizeDialog::IconSizeDialog(QWidget* parent) :
 #include <QVBoxLayout>
 
 IconSizeDialog::IconSizeDialog(QWidget* parent) :
-    KDialog(parent),
-    m_iconSize(0),
-    m_previewSize(0),
-    m_iconSizeSlider(0),
-    m_iconSizeViewer(0),
-    m_previewSizeSlider(0),
-    m_previewSizeViewer(0)
+        KDialog(parent),
+        m_iconSize(0),
+        m_previewSize(0),
+        m_iconSizeSlider(0),
+        m_iconSizeViewer(0),
+        m_previewSizeSlider(0),
+        m_previewSizeViewer(0)
 
 {
     IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
 
 {
     IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
@@ -51,7 +51,7 @@ IconSizeDialog::IconSizeDialog(QWidget* parent) :
     const int spacing = KDialog::spacingHint();
 
     setCaption(i18n("Change Icon & Preview Size"));
     const int spacing = KDialog::spacingHint();
 
     setCaption(i18n("Change Icon & Preview Size"));
-    setButtons(Ok|Cancel);
+    setButtons(Ok | Cancel);
     setDefaultButton(Ok);
 
     QWidget* main = new QWidget();
     setDefaultButton(Ok);
 
     QWidget* main = new QWidget();
@@ -112,8 +112,7 @@ IconSizeDialog::IconSizeDialog(QWidget* parent) :
 }
 
 IconSizeDialog::~IconSizeDialog()
 }
 
 IconSizeDialog::~IconSizeDialog()
-{
-}
+{}
 
 void IconSizeDialog::slotButtonClicked(int button)
 {
 
 void IconSizeDialog::slotButtonClicked(int button)
 {
@@ -160,12 +159,12 @@ int IconSizeDialog::iconSize(int sliderValue) const
 {
     int size = K3Icon::SizeMedium;
     switch (sliderValue) {
 {
     int size = K3Icon::SizeMedium;
     switch (sliderValue) {
-        case 0: size = K3Icon::SizeSmall; break;
-        case 1: size = K3Icon::SizeSmallMedium; break;
-        case 2: size = K3Icon::SizeMedium; break;
-        case 3: size = K3Icon::SizeLarge; break;
-        case 4: size = K3Icon::SizeHuge; break;
-        case 5: size = K3Icon::SizeEnormous; break;
+    case 0: size = K3Icon::SizeSmall; break;
+    case 1: size = K3Icon::SizeSmallMedium; break;
+    case 2: size = K3Icon::SizeMedium; break;
+    case 3: size = K3Icon::SizeLarge; break;
+    case 4: size = K3Icon::SizeHuge; break;
+    case 5: size = K3Icon::SizeEnormous; break;
     }
     return size;
 }
     }
     return size;
 }
@@ -174,13 +173,13 @@ int IconSizeDialog::sliderValue(int iconSize) const
 {
     int value = 0;
     switch (iconSize) {
 {
     int value = 0;
     switch (iconSize) {
-        case K3Icon::SizeSmall:       value = 0; break;
-        case K3Icon::SizeSmallMedium: value = 1; break;
-        case K3Icon::SizeMedium:      value = 2; break;
-        case K3Icon::SizeLarge:       value = 3; break;
-        case K3Icon::SizeHuge:        value = 4; break;
-        case K3Icon::SizeEnormous:    value = 5; break;
-        default: break;
+    case K3Icon::SizeSmall:       value = 0; break;
+    case K3Icon::SizeSmallMedium: value = 1; break;
+    case K3Icon::SizeMedium:      value = 2; break;
+    case K3Icon::SizeLarge:       value = 3; break;
+    case K3Icon::SizeHuge:        value = 4; break;
+    case K3Icon::SizeEnormous:    value = 5; break;
+    default: break;
     }
     return value;
 }
     }
     return value;
 }
index 9fffa3dfc6ac68995919945b4b79c4609afb21f3..33cd83725ac54cc114c63f963d90aeb485f747f2 100644 (file)
@@ -46,8 +46,14 @@ public:
     explicit IconSizeDialog(QWidget* parent);
     virtual ~IconSizeDialog();
 
     explicit IconSizeDialog(QWidget* parent);
     virtual ~IconSizeDialog();
 
-    int iconSize() const { return m_iconSize; }
-    int previewSize() const { return m_previewSize; }
+    int iconSize() const
+    {
+        return m_iconSize;
+    }
+    int previewSize() const
+    {
+        return m_previewSize;
+    }
 
 protected slots:
     virtual void slotButtonClicked(int button);
 
 protected slots:
     virtual void slotButtonClicked(int button);
index 3492b3a651bb7467004e2f8c188844ec81f57e13..84270a71d239ac765b22e1fe4d4832789596a90c 100644 (file)
 #include <QtDebug>
 
 IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
 #include <QtDebug>
 
 IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
-                                             QWidget* parent) :
-    KVBox(parent),
-    m_mainWindow(mainWindow),
-    m_iconSize(0),
-    m_previewSize(0),
-    m_iconSizeButton(0),
-    m_textWidthBox(0),
-    m_fontRequester(0),
-    m_textlinesCountBox(0),
-    m_arrangementBox(0),
-    m_gridSpacingBox(0)
+        QWidget* parent) :
+        KVBox(parent),
+        m_mainWindow(mainWindow),
+        m_iconSize(0),
+        m_previewSize(0),
+        m_iconSizeButton(0),
+        m_textWidthBox(0),
+        m_fontRequester(0),
+        m_textlinesCountBox(0),
+        m_arrangementBox(0),
+        m_gridSpacingBox(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -96,13 +96,12 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
     const int remainingWidth = settings->gridWidth() - settings->iconSize();
     if (leftToRightArrangement) {
         textWidthIndex = (remainingWidth - LeftToRightBase) / LeftToRightInc;
     const int remainingWidth = settings->gridWidth() - settings->iconSize();
     if (leftToRightArrangement) {
         textWidthIndex = (remainingWidth - LeftToRightBase) / LeftToRightInc;
-    }
-    else {
+    } else {
         textWidthIndex = (remainingWidth - TopToBottomBase) / TopToBottomInc;
     }
     // ensure that chosen index is always valid
         textWidthIndex = (remainingWidth - TopToBottomBase) / TopToBottomInc;
     }
     // ensure that chosen index is always valid
-    textWidthIndex = qMax(textWidthIndex,0); 
-    textWidthIndex = qMin(textWidthIndex,m_textWidthBox->count()-1);
+    textWidthIndex = qMax(textWidthIndex, 0);
+    textWidthIndex = qMin(textWidthIndex, m_textWidthBox->count() - 1);
 
     m_textWidthBox->setCurrentIndex(textWidthIndex);
 
 
     m_textWidthBox->setCurrentIndex(textWidthIndex);
 
@@ -144,8 +143,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
 }
 
 IconsViewSettingsPage::~IconsViewSettingsPage()
 }
 
 IconsViewSettingsPage::~IconsViewSettingsPage()
-{
-}
+{}
 
 void IconsViewSettingsPage::applySettings()
 {
 
 void IconsViewSettingsPage::applySettings()
 {
@@ -170,8 +168,7 @@ void IconsViewSettingsPage::applySettings()
     if (arrangement == QListView::TopToBottom) {
         gridWidth += TopToBottomBase + textSizeIndex * TopToBottomInc;
         gridHeight += fontSize * 6;
     if (arrangement == QListView::TopToBottom) {
         gridWidth += TopToBottomBase + textSizeIndex * TopToBottomInc;
         gridHeight += fontSize * 6;
-    }
-    else {
+    } else {
         gridWidth += LeftToRightBase + textSizeIndex * LeftToRightInc;
     }
 
         gridWidth += LeftToRightBase + textSizeIndex * LeftToRightInc;
     }
 
index a7c38ca95f93c08282fec86652abd685f637177b..42352429b5729ebaa6309375b8f0b2a304b1ceb6 100644 (file)
 #include "metadatawidget.h"
 
 InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
 #include "metadatawidget.h"
 
 InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
-    SidebarPage(parent),
-    m_multipleSelection(false), //TODO:check if I'm needed
-    m_pendingPreview(false),
-    m_timer(0),
-    m_currentSelection(KFileItemList()),
-    m_preview(0),
-    m_name(0),
-    m_infos(0)
+        SidebarPage(parent),
+        m_multipleSelection(false), //TODO:check if I'm needed
+        m_pendingPreview(false),
+        m_timer(0),
+        m_currentSelection(KFileItemList()),
+        m_preview(0),
+        m_name(0),
+        m_infos(0)
 {
     const int spacing = KDialog::spacingHint();
 
 {
     const int spacing = KDialog::spacingHint();
 
@@ -94,8 +94,8 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
 
     KSeparator* sep2 = new KSeparator(this);
 
 
     KSeparator* sep2 = new KSeparator(this);
 
-    if ( MetaDataWidget::metaDataAvailable() )
-        m_metadataWidget = new MetaDataWidget( this );
+    if (MetaDataWidget::metaDataAvailable())
+        m_metadataWidget = new MetaDataWidget(this);
     else
         m_metadataWidget = 0;
 
     else
         m_metadataWidget = 0;
 
@@ -109,9 +109,9 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
     layout->addWidget(sep1);
     layout->addWidget(m_infos);
     layout->addWidget(sep2);
     layout->addWidget(sep1);
     layout->addWidget(m_infos);
     layout->addWidget(sep2);
-    if ( m_metadataWidget ) {
-        layout->addWidget( m_metadataWidget );
-        layout->addWidget( new KSeparator( this ) );
+    if (m_metadataWidget) {
+        layout->addWidget(m_metadataWidget);
+        layout->addWidget(new KSeparator(this));
     }
     layout->addWidget(m_actionBox);
     // ensure that widgets in the information side bar are aligned towards the top
     }
     layout->addWidget(m_actionBox);
     // ensure that widgets in the information side bar are aligned towards the top
@@ -120,8 +120,7 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
 }
 
 InfoSidebarPage::~InfoSidebarPage()
 }
 
 InfoSidebarPage::~InfoSidebarPage()
-{
-}
+{}
 
 void InfoSidebarPage::setUrl(const KUrl& url)
 {
 
 void InfoSidebarPage::setUrl(const KUrl& url)
 {
@@ -157,7 +156,7 @@ void InfoSidebarPage::showItemInfo()
 
     KFileItemList selectedItems = m_currentSelection;
     KUrl file;
 
     KFileItemList selectedItems = m_currentSelection;
     KUrl file;
-    if(selectedItems.count() == 0) {
+    if (selectedItems.count() == 0) {
         file = m_shownUrl;
     } else {
         file = selectedItems[0]->url();
         file = m_shownUrl;
     } else {
         file = selectedItems[0]->url();
@@ -168,9 +167,8 @@ void InfoSidebarPage::showItemInfo()
                                            K3Icon::NoGroup,
                                            K3Icon::SizeEnormous);
         m_preview->setPixmap(icon);
                                            K3Icon::NoGroup,
                                            K3Icon::SizeEnormous);
         m_preview->setPixmap(icon);
-        m_name->setText(i18n("%1 items selected",selectedItems.count()));
-    }
-    else if (!applyBookmark(file)) {
+        m_name->setText(i18n("%1 items selected", selectedItems.count()));
+    } else if (!applyBookmark(file)) {
         // try to get a preview pixmap from the item...
         KUrl::List list;
         list.append(file);
         // try to get a preview pixmap from the item...
         KUrl::List list;
         list.append(file);
@@ -231,8 +229,7 @@ void InfoSidebarPage::startService(int index)
     if (m_currentSelection.count() > 0) {
         // TODO: Use "at()" as soon as executeService is fixed to take a const param (BIC)
         KDesktopFileActions::executeService(m_currentSelection.urlList(), m_actionsVector[index]);
     if (m_currentSelection.count() > 0) {
         // TODO: Use "at()" as soon as executeService is fixed to take a const param (BIC)
         KDesktopFileActions::executeService(m_currentSelection.urlList(), m_actionsVector[index]);
-    }
-    else {
+    } else {
         // TODO: likewise
         KDesktopFileActions::executeService(m_shownUrl, m_actionsVector[index]);
     }
         // TODO: likewise
         KDesktopFileActions::executeService(m_shownUrl, m_actionsVector[index]);
     }
@@ -243,7 +240,7 @@ bool InfoSidebarPage::applyBookmark(const KUrl& url)
     KFilePlacesModel *placesModel = DolphinSettings::instance().placesModel();
     int count = placesModel->rowCount();
 
     KFilePlacesModel *placesModel = DolphinSettings::instance().placesModel();
     int count = placesModel->rowCount();
 
-    for (int i=0; i<count; ++i) {
+    for (int i = 0; i < count; ++i) {
         QModelIndex index = placesModel->index(i, 0);
 
         if (url.equals(placesModel->url(index), KUrl::CompareWithoutTrailingSlash)) {
         QModelIndex index = placesModel->index(i, 0);
 
         if (url.equals(placesModel->url(index), KUrl::CompareWithoutTrailingSlash)) {
@@ -269,17 +266,16 @@ void InfoSidebarPage::cancelRequest()
 void InfoSidebarPage::createMetaInfo()
 {
     beginInfoLines();
 void InfoSidebarPage::createMetaInfo()
 {
     beginInfoLines();
-    if(m_currentSelection.size() == 0) {
+    if (m_currentSelection.size() == 0) {
         KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
         fileItem.refresh();
 
         if (fileItem.isDir()) {
             addInfoLine(i18n("Type:"), i18n("Directory"));
         }
         KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
         fileItem.refresh();
 
         if (fileItem.isDir()) {
             addInfoLine(i18n("Type:"), i18n("Directory"));
         }
-        if ( MetaDataWidget::metaDataAvailable() )
-            m_metadataWidget->setFile( fileItem.url() );
-    }
-    else if (m_currentSelection.count() == 1) {
+        if (MetaDataWidget::metaDataAvailable())
+            m_metadataWidget->setFile(fileItem.url());
+    } else if (m_currentSelection.count() == 1) {
         KFileItem* fileItem = m_currentSelection.at(0);
         addInfoLine(i18n("Type:"), fileItem->mimeComment());
 
         KFileItem* fileItem = m_currentSelection.at(0);
         addInfoLine(i18n("Type:"), fileItem->mimeComment());
 
@@ -297,12 +293,11 @@ void InfoSidebarPage::createMetaInfo()
                 }
             }
         }
                 }
             }
         }
-        if ( MetaDataWidget::metaDataAvailable() )
-            m_metadataWidget->setFile( fileItem->url() );
-    }
-    else {
-        if ( MetaDataWidget::metaDataAvailable() )
-            m_metadataWidget->setFiles( m_currentSelection.urlList() );
+        if (MetaDataWidget::metaDataAvailable())
+            m_metadataWidget->setFile(fileItem->url());
+    } else {
+        if (MetaDataWidget::metaDataAvailable())
+            m_metadataWidget->setFiles(m_currentSelection.urlList());
         unsigned long int totSize = 0;
         foreach(KFileItem* item, m_currentSelection) {
             totSize += item->size(); //FIXME what to do with directories ? (same with the one-item-selected-code), item->size() does not return the size of the content : not very instinctive for users
         unsigned long int totSize = 0;
         foreach(KFileItem* item, m_currentSelection) {
             totSize += item->size(); //FIXME what to do with directories ? (same with the one-item-selected-code), item->size() does not return the size of the content : not very instinctive for users
@@ -326,19 +321,19 @@ bool InfoSidebarPage::showMetaInfo(const QString& key) const
 {
     // sorted list of keys, where it's data should be shown
     static const char* keys[] = {
 {
     // sorted list of keys, where it's data should be shown
     static const char* keys[] = {
-        "Album",
-        "Artist",
-        "Author",
-        "Bitrate",
-        "Date",
-        "Dimensions",
-        "Genre",
-        "Length",
-        "Lines",
-        "Pages",
-        "Title",
-        "Words"
-    };
+                                    "Album",
+                                    "Artist",
+                                    "Author",
+                                    "Bitrate",
+                                    "Date",
+                                    "Dimensions",
+                                    "Genre",
+                                    "Length",
+                                    "Lines",
+                                    "Pages",
+                                    "Title",
+                                    "Words"
+                                };
 
     // do a binary search for the key...
     int top = 0;
 
     // do a binary search for the key...
     int top = 0;
@@ -348,11 +343,9 @@ bool InfoSidebarPage::showMetaInfo(const QString& key) const
         const int result = key.compare(keys[middle]);
         if (result < 0) {
             bottom = middle - 1;
         const int result = key.compare(keys[middle]);
         if (result < 0) {
             bottom = middle - 1;
-        }
-        else if (result > 0) {
+        } else if (result > 0) {
             top = middle + 1;
             top = middle + 1;
-        }
-        else {
+        } else {
             return true;
         }
     }
             return true;
         }
     }
@@ -400,7 +393,7 @@ void InfoSidebarPage::insertActions()
         QStringList entries = dir.entryList(QStringList("*.desktop"), QDir::Files);
 
         for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
         QStringList entries = dir.entryList(QStringList("*.desktop"), QDir::Files);
 
         for (QStringList::ConstIterator entryIt = entries.begin(); entryIt != entries.end(); ++entryIt) {
-            KConfigGroup cfg(KSharedConfig::openConfig( *dirIt + *entryIt, KConfig::OnlyLocal ), "Desktop Entry" );
+            KConfigGroup cfg(KSharedConfig::openConfig(*dirIt + *entryIt, KConfig::OnlyLocal), "Desktop Entry");
             if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
                 const QStringList types = cfg.readEntry("ServiceTypes", QStringList(), ',');
                 for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
             if ((cfg.hasKey("Actions") || cfg.hasKey("X-KDE-GetActionMenu")) && cfg.hasKey("ServiceTypes")) {
                 const QStringList types = cfg.readEntry("ServiceTypes", QStringList(), ',');
                 for (QStringList::ConstIterator it = types.begin(); it != types.end(); ++it) {
@@ -437,7 +430,7 @@ void InfoSidebarPage::insertActions()
                     }
 
                     if (insert) {
                     }
 
                     if (insert) {
-                        const QString submenuName = cfg.readEntry( "X-KDE-Submenu" );
+                        const QString submenuName = cfg.readEntry("X-KDE-Submenu");
                         QMenu* popup = 0;
                         if (!submenuName.isEmpty()) {
                             // create a sub menu containing all actions
                         QMenu* popup = 0;
                         if (!submenuName.isEmpty()) {
                             // create a sub menu containing all actions
@@ -460,14 +453,13 @@ void InfoSidebarPage::insertActions()
                             KDesktopFileActions::Service service = (*serviceIt);
                             if (popup == 0) {
                                 ServiceButton* button = new ServiceButton(KIcon(service.m_strIcon),
                             KDesktopFileActions::Service service = (*serviceIt);
                             if (popup == 0) {
                                 ServiceButton* button = new ServiceButton(KIcon(service.m_strIcon),
-                                                                          service.m_strName,
-                                                                          m_actionBox,
-                                                                          actionsIndex);
+                                                        service.m_strName,
+                                                        m_actionBox,
+                                                        actionsIndex);
                                 connect(button, SIGNAL(requestServiceStart(int)),
                                         this, SLOT(startService(int)));
                                 button->show();
                                 connect(button, SIGNAL(requestServiceStart(int)),
                                         this, SLOT(startService(int)));
                                 button->show();
-                            }
-                            else {
+                            } else {
                                 popup->insertItem(KIcon(service.m_strIcon), service.m_strName, actionsIndex);
                             }
 
                                 popup->insertItem(KIcon(service.m_strIcon), service.m_strName, actionsIndex);
                             }
 
@@ -487,9 +479,9 @@ ServiceButton::ServiceButton(const QIcon& icon,
                              const QString& text,
                              QWidget* parent,
                              int index) :
                              const QString& text,
                              QWidget* parent,
                              int index) :
-    QPushButton(icon, text, parent),
-    m_hover(false),
-    m_index(index)
+        QPushButton(icon, text, parent),
+        m_hover(false),
+        m_index(index)
 {
     setEraseColor(palette().brush(QPalette::Background).color());
     setFocusPolicy(Qt::NoFocus);
 {
     setEraseColor(palette().brush(QPalette::Background).color());
     setFocusPolicy(Qt::NoFocus);
@@ -498,8 +490,7 @@ ServiceButton::ServiceButton(const QIcon& icon,
 }
 
 ServiceButton::~ServiceButton()
 }
 
 ServiceButton::~ServiceButton()
-{
-}
+{}
 
 void ServiceButton::paintEvent(QPaintEvent* event)
 {
 
 void ServiceButton::paintEvent(QPaintEvent* event)
 {
@@ -513,8 +504,7 @@ void ServiceButton::paintEvent(QPaintEvent* event)
     if (m_hover) {
         backgroundColor = KGlobalSettings::highlightColor();
         foregroundColor = KGlobalSettings::highlightedTextColor();
     if (m_hover) {
         backgroundColor = KGlobalSettings::highlightColor();
         foregroundColor = KGlobalSettings::highlightedTextColor();
-    }
-    else {
+    } else {
         backgroundColor = palette().brush(QPalette::Background).color();
         foregroundColor = KGlobalSettings::buttonTextColor();
     }
         backgroundColor = palette().brush(QPalette::Background).color();
         foregroundColor = KGlobalSettings::buttonTextColor();
     }
index cd233b6ef29915906c2ab8be59b5bcae1405db42..62d0ac1cb54a507eb20500d10ecf6826d73f7291 100644 (file)
@@ -33,8 +33,9 @@
 #include <kdesktopfileactions.h>
 #include <kvbox.h>
 
 #include <kdesktopfileactions.h>
 #include <kvbox.h>
 
-namespace KIO {
-    class Job;
+namespace KIO
+{
+class Job;
 }
 
 class QPixmap;
 }
 
 class QPixmap;
@@ -54,7 +55,7 @@ class MetaDataWidget;
  */
 class InfoSidebarPage : public SidebarPage
 {
  */
 class InfoSidebarPage : public SidebarPage
 {
-       Q_OBJECT
+    Q_OBJECT
 
 public:
     explicit InfoSidebarPage(QWidget* parent = 0);
 
 public:
     explicit InfoSidebarPage(QWidget* parent = 0);
@@ -139,7 +140,7 @@ private:
     QTimer* m_timer;
     KUrl m_shownUrl;
     KUrl m_urlCandidate;
     QTimer* m_timer;
     KUrl m_shownUrl;
     KUrl m_urlCandidate;
-       KFileItemList m_currentSelection;
+    KFileItemList m_currentSelection;
 
     PixmapViewer* m_preview;
     QLabel* m_name;
 
     PixmapViewer* m_preview;
     QLabel* m_name;
index b0843a5e7a6206022fa535e37a92b5bf8c980b59..98a6a87f1fd437be497437b4efc59b129831c4e7 100644 (file)
 #include <klocale.h>
 
 static KCmdLineOptions options[] =
 #include <klocale.h>
 
 static KCmdLineOptions options[] =
-{
-    { "+[Url]", I18N_NOOP( "Document to open" ), 0 },
-    KCmdLineLastOption
-};
+    {
+        { "+[Url]", I18N_NOOP("Document to open"), 0
+        },
+        KCmdLineLastOption
+    };
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
@@ -64,11 +65,11 @@ int main(int argc, char **argv)
 #if 0
     if (false /* KDE4-TODO: app.isSessionRestored() */) {
         int n = 1;
 #if 0
     if (false /* KDE4-TODO: app.isSessionRestored() */) {
         int n = 1;
-        while (KMainWindow::canBeRestored(n)){
+        while (KMainWindow::canBeRestored(n)) {
             Dolphin::mainWin().restore(n);
             ++n;
         }
     } else {
 #endif
             Dolphin::mainWin().restore(n);
             ++n;
         }
     } else {
 #endif
-    return app.exec();
-}
+        return app.exec();
+    }
index e8cb3dbea9062b216082dfa4606053638de4745a..85c1fa30f31d25cd82c053c4707615847c145ac4 100644 (file)
@@ -50,17 +50,17 @@ class MetaDataWidget::Private
 {
 public:
 #ifdef HAVE_KMETADATA
 {
 public:
 #ifdef HAVE_KMETADATA
-    void loadComment( const QString& comment ) {
-        editComment->blockSignals( true );
-        if ( comment.isEmpty() ) {
-            editComment->setFontItalic( true );
-            editComment->setText( i18n( "Click to add comment..." ) );
+    void loadComment(const QString& comment)
+    {
+        editComment->blockSignals(true);
+        if (comment.isEmpty()) {
+            editComment->setFontItalic(true);
+            editComment->setText(i18n("Click to add comment..."));
+        } else {
+            editComment->setFontItalic(false);
+            editComment->setText(comment);
         }
         }
-        else {
-            editComment->setFontItalic( false );
-            editComment->setText( comment );
-        }
-        editComment->blockSignals( false );
+        editComment->blockSignals(false);
     }
 
     KUrl fileUrl;
     }
 
     KUrl fileUrl;
@@ -74,34 +74,34 @@ public:
 };
 
 
 };
 
 
-MetaDataWidget::MetaDataWidget( QWidget* parent )
-    : QWidget( parent )
+MetaDataWidget::MetaDataWidget(QWidget* parent)
+        : QWidget(parent)
 {
 #ifdef HAVE_KMETADATA
     d = new Private;
 {
 #ifdef HAVE_KMETADATA
     d = new Private;
-    d->editComment = new QTextEdit( this );
-    d->tagWidget = new Nepomuk::KMetaData::TagWidget( this );
-    d->ratingWidget = new KRatingWidget( this );
-    connect( d->ratingWidget, SIGNAL(ratingChanged(int)), this, SLOT(slotRatingChanged(int)) );
-    connect( d->editComment, SIGNAL( textChanged() ), this, SLOT( slotCommentChanged() ) );
-
-    QVBoxLayout* lay = new QVBoxLayout( this );
-    lay->setMargin( 0 );
+    d->editComment = new QTextEdit(this);
+    d->tagWidget = new Nepomuk::KMetaData::TagWidget(this);
+    d->ratingWidget = new KRatingWidget(this);
+    connect(d->ratingWidget, SIGNAL(ratingChanged(int)), this, SLOT(slotRatingChanged(int)));
+    connect(d->editComment, SIGNAL(textChanged()), this, SLOT(slotCommentChanged()));
+
+    QVBoxLayout* lay = new QVBoxLayout(this);
+    lay->setMargin(0);
     QHBoxLayout* hbox = new QHBoxLayout;
     QHBoxLayout* hbox = new QHBoxLayout;
-    hbox->addWidget( new QLabel( i18n( "Rating:" ), this ) );
-    hbox->addStretch( 1 );
-    hbox->addWidget( d->ratingWidget );
-    lay->addLayout( hbox );
-    lay->addWidget( d->editComment );
+    hbox->addWidget(new QLabel(i18n("Rating:"), this));
+    hbox->addStretch(1);
+    hbox->addWidget(d->ratingWidget);
+    lay->addLayout(hbox);
+    lay->addWidget(d->editComment);
     hbox = new QHBoxLayout;
     hbox = new QHBoxLayout;
-    hbox->addWidget( new QLabel( i18n( "Tags:" ), this ) );
-    hbox->addWidget( d->tagWidget, 1 );
-    lay->addLayout( hbox );
+    hbox->addWidget(new QLabel(i18n("Tags:"), this));
+    hbox->addWidget(d->tagWidget, 1);
+    lay->addLayout(hbox);
 
 
-    d->editComment->installEventFilter( this );
-    d->editComment->viewport()->installEventFilter( this );
+    d->editComment->installEventFilter(this);
+    d->editComment->viewport()->installEventFilter(this);
 #else
 #else
-    d=0L;    
+    d = 0L;
 #endif
 }
 
 #endif
 }
 
@@ -112,24 +112,24 @@ MetaDataWidget::~MetaDataWidget()
 }
 
 
 }
 
 
-void MetaDataWidget::setFile( const KUrl& url )
+void MetaDataWidget::setFile(const KUrl& url)
 {
 #ifdef HAVE_KMETADATA
     d->fileUrl = url;
 {
 #ifdef HAVE_KMETADATA
     d->fileUrl = url;
-    d->file = Nepomuk::KMetaData::File( url.url() );
-    d->file.setLocation( url.url() );
-    d->ratingWidget->setRating( d->file.getRating() );
-    d->tagWidget->setTaggedResource( d->file );
-    d->loadComment( d->file.getComment() );
+    d->file = Nepomuk::KMetaData::File(url.url());
+    d->file.setLocation(url.url());
+    d->ratingWidget->setRating(d->file.getRating());
+    d->tagWidget->setTaggedResource(d->file);
+    d->loadComment(d->file.getComment());
 #endif
 }
 
 
 #endif
 }
 
 
-void MetaDataWidget::setFiles( const KUrl::List urls )
+void MetaDataWidget::setFiles(const KUrl::List urls)
 {
 #ifdef HAVE_KMETADATA
     // FIXME: support multiple files
 {
 #ifdef HAVE_KMETADATA
     // FIXME: support multiple files
-    setFile( urls.first() );
+    setFile(urls.first());
 #endif
 }
 
 #endif
 }
 
@@ -137,37 +137,36 @@ void MetaDataWidget::setFiles( const KUrl::List urls )
 void MetaDataWidget::slotCommentChanged()
 {
 #ifdef HAVE_KMETADATA
 void MetaDataWidget::slotCommentChanged()
 {
 #ifdef HAVE_KMETADATA
-    d->file.setComment( d->editComment->toPlainText() );
+    d->file.setComment(d->editComment->toPlainText());
 #endif
 }
 
 
 #endif
 }
 
 
-void MetaDataWidget::slotRatingChanged( int r )
+void MetaDataWidget::slotRatingChanged(int r)
 {
 #ifdef HAVE_KMETADATA
 {
 #ifdef HAVE_KMETADATA
-    d->file.setRating( r );
+    d->file.setRating(r);
 #endif
 }
 
 
 #endif
 }
 
 
-bool MetaDataWidget::eventFilter( QObject* obj, QEvent* event )
+bool MetaDataWidget::eventFilter(QObject* obj, QEvent* event)
 {
 #ifdef HAVE_KMETADATA
 {
 #ifdef HAVE_KMETADATA
-    if (  obj == d->editComment->viewport()
-          || obj == d->editComment ) {
-        if ( event->type() == QEvent::FocusOut ) {
+    if (obj == d->editComment->viewport()
+            || obj == d->editComment) {
+        if (event->type() == QEvent::FocusOut) {
             // make sure the info text is displayed again
             // make sure the info text is displayed again
-            d->loadComment( d->editComment->toPlainText() );
-        }
-        else if ( event->type() == QEvent::FocusIn ) {
-            d->editComment->setFontItalic( false );
-            if ( d->file.getComment().isEmpty() )
-                d->editComment->setText( QString() );
+            d->loadComment(d->editComment->toPlainText());
+        } else if (event->type() == QEvent::FocusIn) {
+            d->editComment->setFontItalic(false);
+            if (d->file.getComment().isEmpty())
+                d->editComment->setText(QString());
         }
     }
 #endif
 
         }
     }
 #endif
 
-    return QWidget::eventFilter( obj, event );
+    return QWidget::eventFilter(obj, event);
 }
 
 #include "metadatawidget.moc"
 }
 
 #include "metadatawidget.moc"
index 0b544e23d45aaa6c5ff1883eff52bc517e3e69fa..b51cb593d6f78b1d8552e0eaf6d30b085da00f4c 100644 (file)
@@ -30,7 +30,7 @@ class MetaDataWidget : public QWidget
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
-    MetaDataWidget( QWidget* parent = 0 );
+    MetaDataWidget(QWidget* parent = 0);
     ~MetaDataWidget();
 
     /**
     ~MetaDataWidget();
 
     /**
@@ -39,10 +39,10 @@ public:
      * been initialized properly.
      */
     static bool metaDataAvailable();
      * been initialized properly.
      */
     static bool metaDataAvailable();
-    
+
 public Q_SLOTS:
 public Q_SLOTS:
-    void setFile( const KUrl& url );
-    void setFiles( const KUrl::List urls );
+    void setFile(const KUrl& url);
+    void setFiles(const KUrl::List urls);
 
 signals:
     /**
 
 signals:
     /**
@@ -53,10 +53,10 @@ signals:
 
 private Q_SLOTS:
     void slotCommentChanged();
 
 private Q_SLOTS:
     void slotCommentChanged();
-    void slotRatingChanged( int r );
+    void slotRatingChanged(int r);
 
 protected:
 
 protected:
-    bool eventFilter( QObject* obj, QEvent* event );
+    bool eventFilter(QObject* obj, QEvent* event);
 
 private:
     class Private;
 
 private:
     class Private;
index ae739cf43447e5d7b673a8129625e68f833d3f56..798771078e3677d7e0c60cab908283780472c9a5 100644 (file)
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *   
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
 #include "pixmapviewer.h"
  ***************************************************************************/
 
 #include "pixmapviewer.h"
 #include <QPaintEvent>
 
 PixmapViewer::PixmapViewer(QWidget* parent) :
 #include <QPaintEvent>
 
 PixmapViewer::PixmapViewer(QWidget* parent) :
-    QWidget(parent)
+        QWidget(parent)
 {
     setMinimumWidth(K3Icon::SizeEnormous);
     setMinimumWidth(K3Icon::SizeEnormous);
 }
 
 PixmapViewer::~PixmapViewer()
 {
     setMinimumWidth(K3Icon::SizeEnormous);
     setMinimumWidth(K3Icon::SizeEnormous);
 }
 
 PixmapViewer::~PixmapViewer()
-{
-}
+{}
 
 void PixmapViewer::setPixmap(const QPixmap& pixmap)
 {
 
 void PixmapViewer::setPixmap(const QPixmap& pixmap)
 {
index fadcd225906d80e344482a9323625d368e25ce4a..40ff9e55f0f7a1ffde025e6e0c7869c2e60432ff 100644 (file)
@@ -39,7 +39,10 @@ public:
     explicit PixmapViewer(QWidget* parent);
     virtual ~PixmapViewer();
     void setPixmap(const QPixmap& pixmap);
     explicit PixmapViewer(QWidget* parent);
     virtual ~PixmapViewer();
     void setPixmap(const QPixmap& pixmap);
-    const QPixmap& pixmap() const { return m_pixmap; }
+    const QPixmap& pixmap() const
+    {
+        return m_pixmap;
+    }
 
 protected:
     virtual void paintEvent(QPaintEvent* event);
 
 protected:
     virtual void paintEvent(QPaintEvent* event);
index c3fe9d7223a89e07a67cf5501adf88b7ffc51b48..190f64b93f5cb7dc771e36641630b1ea593c46b9 100644 (file)
@@ -26,8 +26,8 @@
 #include <QVBoxLayout>
 
 RenameDialog::RenameDialog(const KUrl::List& items) :
 #include <QVBoxLayout>
 
 RenameDialog::RenameDialog(const KUrl::List& items) :
-    KDialog(),
-    m_renameOneItem(false)
+        KDialog(),
+        m_renameOneItem(false)
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(320, minSize.height()));
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(320, minSize.height()));
@@ -37,7 +37,7 @@ RenameDialog::RenameDialog(const KUrl::List& items) :
     m_renameOneItem = (itemCount == 1);
 
     setCaption(m_renameOneItem ? i18n("Rename Item") : i18n("Rename Items"));
     m_renameOneItem = (itemCount == 1);
 
     setCaption(m_renameOneItem ? i18n("Rename Item") : i18n("Rename Items"));
-    setButtons(Ok|Cancel);
+    setButtons(Ok | Cancel);
     setDefaultButton(Ok);
 
     setButtonGuiItem(Ok, KGuiItem(i18n("Rename"), "dialog-apply"));
     setDefaultButton(Ok);
 
     setButtonGuiItem(Ok, KGuiItem(i18n("Rename"), "dialog-apply"));
@@ -54,15 +54,14 @@ RenameDialog::RenameDialog(const KUrl::List& items) :
         m_newName = url.fileName();
         editLabel = new QLabel(i18n("Rename the item '%1' to:", m_newName),
                                page);
         m_newName = url.fileName();
         editLabel = new QLabel(i18n("Rename the item '%1' to:", m_newName),
                                page);
-    }
-    else {
+    } else {
         m_newName = i18n("New name #");
         editLabel = new QLabel(i18n("Rename the %1 selected items to:", itemCount),
                                page);
     }
 
     m_lineEdit = new KLineEdit(page);
         m_newName = i18n("New name #");
         editLabel = new QLabel(i18n("Rename the %1 selected items to:", itemCount),
                                page);
     }
 
     m_lineEdit = new KLineEdit(page);
-    QString postfix(items[0].prettyUrl().section('.',1));
+    QString postfix(items[0].prettyUrl().section('.', 1));
     if (postfix.length() > 0) {
         // The first item seems to have a postfix (e. g. 'jpg' or 'txt'). Now
         // check whether all other items have the same postfix. If this is the
     if (postfix.length() > 0) {
         // The first item seems to have a postfix (e. g. 'jpg' or 'txt'). Now
         // check whether all other items have the same postfix. If this is the
@@ -86,8 +85,7 @@ RenameDialog::RenameDialog(const KUrl::List& items) :
     if (postfixLength > 0) {
         if (m_renameOneItem) {
             selectionLength -= postfixLength;
     if (postfixLength > 0) {
         if (m_renameOneItem) {
             selectionLength -= postfixLength;
-        }
-        else {
+        } else {
             m_newName.append(postfix);
         }
     }
             m_newName.append(postfix);
         }
     }
@@ -106,8 +104,7 @@ RenameDialog::RenameDialog(const KUrl::List& items) :
 }
 
 RenameDialog::~RenameDialog()
 }
 
 RenameDialog::~RenameDialog()
-{
-}
+{}
 
 void RenameDialog::slotButtonClicked(int button)
 {
 
 void RenameDialog::slotButtonClicked(int button)
 {
@@ -115,8 +112,7 @@ void RenameDialog::slotButtonClicked(int button)
         m_newName = m_lineEdit->text();
         if (m_newName.isEmpty()) {
             m_errorString = i18n("The new name is empty. A name with at least one character must be entered.");
         m_newName = m_lineEdit->text();
         if (m_newName.isEmpty()) {
             m_errorString = i18n("The new name is empty. A name with at least one character must be entered.");
-        }
-        else if (!m_renameOneItem && m_newName.contains('#') != 1) {
+        } else if (!m_renameOneItem && m_newName.contains('#') != 1) {
             m_newName.truncate(0);
             m_errorString = i18n("The name must contain exactly one # character.");
         }
             m_newName.truncate(0);
             m_errorString = i18n("The name must contain exactly one # character.");
         }
index 220b8b803c3fda666e858f92943c5d2242d2965d..cc2cb540741c92c765ef21b347940787e9f63fbb 100644 (file)
@@ -62,12 +62,18 @@ public:
      * been deleted by the user, although more then one item should be
      * renamed).
      */
      * been deleted by the user, although more then one item should be
      * renamed).
      */
-    const QString& newName() const { return m_newName; }
+    const QString& newName() const
+    {
+        return m_newName;
+    }
 
     /**
      * Returns the error string, if Dialog::newName() returned an empty string.
      */
 
     /**
      * Returns the error string, if Dialog::newName() returned an empty string.
      */
-    const QString& errorString() const { return m_errorString; }
+    const QString& errorString() const
+    {
+        return m_errorString;
+    }
 
 protected slots:
     virtual void slotButtonClicked(int button);
 
 protected slots:
     virtual void slotButtonClicked(int button);
index 6f8dae7c5c117f208d1d0496457bede65b4f5065..6f8dcbfb6614122e4da84b3ec110ecaf759f68bc 100644 (file)
 #include "settingspagebase.h"
 
 SettingsPageBase::SettingsPageBase(QWidget* parent) :
 #include "settingspagebase.h"
 
 SettingsPageBase::SettingsPageBase(QWidget* parent) :
-    QWidget(parent)
-{
-}
+        QWidget(parent)
+{}
 
 SettingsPageBase::~SettingsPageBase()
 
 SettingsPageBase::~SettingsPageBase()
-{
-}
+{}
 
 
 #include "settingspagebase.moc"
 
 
 #include "settingspagebase.moc"
index 5b0e68f288a2fd7ca788b7b4b9eefced76097bd9..c6c120f0e1af54b475d712399c55f06f4643878e 100644 (file)
 #include <kurl.h>
 
 SidebarPage::SidebarPage(QWidget* parent) :
 #include <kurl.h>
 
 SidebarPage::SidebarPage(QWidget* parent) :
-    QWidget(parent),
-    m_url(KUrl()),
-    m_currentSelection(KFileItemList())
-{
-}
+        QWidget(parent),
+        m_url(KUrl()),
+        m_currentSelection(KFileItemList())
+{}
 
 SidebarPage::~SidebarPage()
 
 SidebarPage::~SidebarPage()
-{
-}
+{}
 
 void SidebarPage::setUrl(const KUrl& url)
 {
 
 void SidebarPage::setUrl(const KUrl& url)
 {
index e992955a24720ac98e7f1a6892d15a292e446243..587e435c14bfddca9260bbb7b116e684a280971a 100644 (file)
@@ -31,9 +31,9 @@
  */
 class SidebarPage : public QWidget
 {
  */
 class SidebarPage : public QWidget
 {
-       Q_OBJECT
+    Q_OBJECT
 public:
 public:
-    explicit SidebarPage(QWidget* parent=0);
+    explicit SidebarPage(QWidget* parent = 0);
     virtual ~SidebarPage();
 
 public slots:
     virtual ~SidebarPage();
 
 public slots:
@@ -41,7 +41,7 @@ public slots:
      * This is invoked every time the folder being displayed in the
      * file-management views changes.
      */
      * This is invoked every time the folder being displayed in the
      * file-management views changes.
      */
-       virtual void setUrl(const KUrl& url);
+    virtual void setUrl(const KUrl& url);
 
     /**
      * This is invoked to inform the sidebar that the user has selected a new
 
     /**
      * This is invoked to inform the sidebar that the user has selected a new
index 9390e5672eab7d4701accdd371bfb6b7e077e353..30ad6b169a16fee214b8fe79415aeb6f205a620f 100644 (file)
@@ -27,7 +27,7 @@
 #include <QHeaderView>
 
 SidebarTreeView::SidebarTreeView(QWidget* parent) :
 #include <QHeaderView>
 
 SidebarTreeView::SidebarTreeView(QWidget* parent) :
-    QTreeView(parent)
+        QTreeView(parent)
 {
     setAcceptDrops(true);
     setUniformRowHeights(true);
 {
     setAcceptDrops(true);
     setUniformRowHeights(true);
@@ -43,8 +43,7 @@ SidebarTreeView::SidebarTreeView(QWidget* parent) :
 }
 
 SidebarTreeView::~SidebarTreeView()
 }
 
 SidebarTreeView::~SidebarTreeView()
-{
-}
+{}
 
 bool SidebarTreeView::event(QEvent* event)
 {
 
 bool SidebarTreeView::event(QEvent* event)
 {
@@ -73,8 +72,7 @@ void SidebarTreeView::dropEvent(QDropEvent* event)
     const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
     if (urls.isEmpty() || (event->source() == this)) {
         QTreeView::dropEvent(event);
     const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
     if (urls.isEmpty() || (event->source() == this)) {
         QTreeView::dropEvent(event);
-    }
-    else {
+    } else {
         event->acceptProposedAction();
         const QModelIndex index = indexAt(event->pos());
         if (index.isValid()) {
         event->acceptProposedAction();
         const QModelIndex index = indexAt(event->pos());
         if (index.isValid()) {
index d4560fb4460a33db3bdfcf1efc6da8552f790a38..d12737151a08d51878611d9444452c5d15d77ec3 100644 (file)
@@ -37,10 +37,10 @@ public:
     virtual ~SidebarTreeView();
 
 signals:
     virtual ~SidebarTreeView();
 
 signals:
-   /**
-     * Is emitted if the URLs \a urls have been dropped to
-     * the index \a index.
-     */
+    /**
+      * Is emitted if the URLs \a urls have been dropped to
+      * the index \a index.
+      */
     void urlsDropped(const KUrl::List& urls,
                      const QModelIndex& index);
 
     void urlsDropped(const KUrl::List& urls,
                      const QModelIndex& index);
 
index c870406d3419258b66f90a51a27f9aba6c8c83cb..7cf5bb68a18cb4feee7ae34c9d31c3bf408bb702 100644 (file)
 #include <QTimer>
 
 StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) :
 #include <QTimer>
 
 StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) :
-    QWidget(parent),
-    m_type(DolphinStatusBar::Default),
-    m_state(Default),
-    m_illumination(0),
-    m_minTextHeight(-1),
-    m_timer(0),
-    m_closeButton(0)
+        QWidget(parent),
+        m_type(DolphinStatusBar::Default),
+        m_state(Default),
+        m_illumination(0),
+        m_minTextHeight(-1),
+        m_timer(0),
+        m_closeButton(0)
 {
     setMinimumHeight(K3Icon::SizeSmall);
 
 {
     setMinimumHeight(K3Icon::SizeSmall);
 
@@ -55,8 +55,7 @@ StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) :
 }
 
 StatusBarMessageLabel::~StatusBarMessageLabel()
 }
 
 StatusBarMessageLabel::~StatusBarMessageLabel()
-{
-}
+{}
 
 void StatusBarMessageLabel::setMessage(const QString& text,
                                        DolphinStatusBar::Type type)
 
 void StatusBarMessageLabel::setMessage(const QString& text,
                                        DolphinStatusBar::Type type)
@@ -68,8 +67,7 @@ void StatusBarMessageLabel::setMessage(const QString& text,
     if (m_type == DolphinStatusBar::Error) {
         if (type == DolphinStatusBar::Error) {
             m_pendingMessages.insert(0, m_text);
     if (m_type == DolphinStatusBar::Error) {
         if (type == DolphinStatusBar::Error) {
             m_pendingMessages.insert(0, m_text);
-        }
-        else if ((m_state != Default) || !m_pendingMessages.isEmpty()) {
+        } else if ((m_state != Default) || !m_pendingMessages.isEmpty()) {
             // a non-error message should not be shown, as there
             // are other pending error messages in the queue
             return;
             // a non-error message should not be shown, as there
             // are other pending error messages in the queue
             return;
@@ -86,29 +84,29 @@ void StatusBarMessageLabel::setMessage(const QString& text,
     const char* iconName = 0;
     QPixmap pixmap;
     switch (type) {
     const char* iconName = 0;
     QPixmap pixmap;
     switch (type) {
-        case DolphinStatusBar::OperationCompleted:
-            iconName = "ok";
-            m_closeButton->hide();
-            break;
-
-        case DolphinStatusBar::Information:
-            iconName = "document-properties";
-            m_closeButton->hide();
-            break;
-
-        case DolphinStatusBar::Error:
-            iconName = "error";
-            m_timer->start(100);
-            m_state = Illuminate;
-
-            updateCloseButtonPosition();
-            m_closeButton->show();
-            break;
-
-        case DolphinStatusBar::Default:
-        default:
-            m_closeButton->hide();
-            break;
+    case DolphinStatusBar::OperationCompleted:
+        iconName = "ok";
+        m_closeButton->hide();
+        break;
+
+    case DolphinStatusBar::Information:
+        iconName = "document-properties";
+        m_closeButton->hide();
+        break;
+
+    case DolphinStatusBar::Error:
+        iconName = "error";
+        m_timer->start(100);
+        m_state = Illuminate;
+
+        updateCloseButtonPosition();
+        m_closeButton->show();
+        break;
+
+    case DolphinStatusBar::Default:
+    default:
+        m_closeButton->hide();
+        break;
     }
 
     m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName);
     }
 
     m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName);
@@ -176,41 +174,39 @@ void StatusBarMessageLabel::resizeEvent(QResizeEvent* event)
 void StatusBarMessageLabel::timerDone()
 {
     switch (m_state) {
 void StatusBarMessageLabel::timerDone()
 {
     switch (m_state) {
-        case Illuminate: {
-            // increase the illumination
-            if (m_illumination < 100) {
-                m_illumination += 20;
-                update();
-            }
-            else {
-                m_state = Illuminated;
-                m_timer->start(5000);
-            }
-            break;
+    case Illuminate: {
+        // increase the illumination
+        if (m_illumination < 100) {
+            m_illumination += 20;
+            update();
+        } else {
+            m_state = Illuminated;
+            m_timer->start(5000);
         }
         }
+        break;
+    }
 
 
-        case Illuminated: {
-            // start desaturation
-            m_state = Desaturate;
-            m_timer->start(100);
-            break;
-        }
+    case Illuminated: {
+        // start desaturation
+        m_state = Desaturate;
+        m_timer->start(100);
+        break;
+    }
 
 
-        case Desaturate: {
-            // desaturate
-            if (m_illumination > 0) {
-                m_illumination -= 5;
-                update();
-            }
-            else {
-                m_state = Default;
-                m_timer->stop();
-            }
-            break;
+    case Desaturate: {
+        // desaturate
+        if (m_illumination > 0) {
+            m_illumination -= 5;
+            update();
+        } else {
+            m_state = Default;
+            m_timer->stop();
         }
         }
+        break;
+    }
 
 
-        default:
-            break;
+    default:
+        break;
     }
 }
 
     }
 }
 
@@ -224,8 +220,8 @@ void StatusBarMessageLabel::assureVisibleText()
     // needed for having a fully visible text
     QFontMetrics fontMetrics(font());
     const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
     // needed for having a fully visible text
     QFontMetrics fontMetrics(font());
     const QRect bounds(fontMetrics.boundingRect(0, 0, availableTextWidth(), height(),
-                                                Qt::AlignVCenter | Qt::TextWordWrap,
-                                                m_text));
+                       Qt::AlignVCenter | Qt::TextWordWrap,
+                       m_text));
     int requiredHeight = bounds.height();
     if (requiredHeight < m_minTextHeight) {
         requiredHeight = m_minTextHeight;
     int requiredHeight = bounds.height();
     if (requiredHeight < m_minTextHeight) {
         requiredHeight = m_minTextHeight;
@@ -244,8 +240,7 @@ void StatusBarMessageLabel::assureVisibleText()
         }
         setMinimumHeight(minHeight);
         updateGeometry();
         }
         setMinimumHeight(minHeight);
         updateGeometry();
-    }
-    else if (minHeight > requiredHeight) {
+    } else if (minHeight > requiredHeight) {
         minHeight -= gap;
         if (minHeight < requiredHeight) {
             minHeight = requiredHeight;
         minHeight -= gap;
         if (minHeight < requiredHeight) {
             minHeight = requiredHeight;
index 9f7c7a4a6c6c8d6ef57fc1b140e060082f36aff0..678fde08b89b6c62e8b1b56869badae879e5afed 100644 (file)
@@ -51,15 +51,30 @@ public:
 
     void setMessage(const QString& text, DolphinStatusBar::Type type);
 
 
     void setMessage(const QString& text, DolphinStatusBar::Type type);
 
-    DolphinStatusBar::Type type() const { return m_type; }
-    const QString& text() const { return m_text; }
-
-    void setDefaultText(const QString& text) { m_defaultText = text; }
-    const QString& defaultText() const { return m_defaultText; }
+    DolphinStatusBar::Type type() const
+    {
+        return m_type;
+    }
+    const QString& text() const
+    {
+        return m_text;
+    }
+
+    void setDefaultText(const QString& text)
+    {
+        m_defaultText = text;
+    }
+    const QString& defaultText() const
+    {
+        return m_defaultText;
+    }
 
     // TODO: maybe a better approach is possible with the size hint
     void setMinimumTextHeight(int min);
 
     // TODO: maybe a better approach is possible with the size hint
     void setMinimumTextHeight(int min);
-    int minimumTextHeight() const { return m_minTextHeight; }
+    int minimumTextHeight() const
+    {
+        return m_minTextHeight;
+    }
 
     /**
      * Returns the gap of the width of the current set text to the
 
     /**
      * Returns the gap of the width of the current set text to the
@@ -116,14 +131,18 @@ private:
     void reset();
 
 private:
     void reset();
 
 private:
-    enum State {
+    enum State
+    {
         Default,
         Illuminate,
         Illuminated,
         Desaturate
     };
 
         Default,
         Illuminate,
         Illuminated,
         Desaturate
     };
 
-    enum { GeometryTimeout = 100 };
+    enum
+    {
+        GeometryTimeout = 100
+    };
 
     DolphinStatusBar::Type m_type;
     State m_state;
 
     DolphinStatusBar::Type m_type;
     State m_state;
@@ -140,7 +159,10 @@ private:
                      const QColor& c2,
                      int percent) const;
 
                      const QColor& c2,
                      int percent) const;
 
-    int borderGap() const { return 2; }
+    int borderGap() const
+    {
+        return 2;
+    }
 };
 
 #endif
 };
 
 #endif
index c648351ebcecc88c105e645934eba9c63449ec93..a21f22c321be4dbb3dde1622807bf458effbea6b 100644 (file)
 #include <kio/job.h>
 
 StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
 #include <kio/job.h>
 
 StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
-    QWidget(parent),
-    m_gettingSize(false),
-    m_kBSize(0),
-    m_kBAvailable(0)
+        QWidget(parent),
+        m_gettingSize(false),
+        m_kBSize(0),
+        m_kBAvailable(0)
 {
     setMinimumWidth(200);
 
 {
     setMinimumWidth(200);
 
@@ -45,8 +45,7 @@ StatusBarSpaceInfo::StatusBarSpaceInfo(QWidget* parent) :
 }
 
 StatusBarSpaceInfo::~StatusBarSpaceInfo()
 }
 
 StatusBarSpaceInfo::~StatusBarSpaceInfo()
-{
-}
+{}
 
 void StatusBarSpaceInfo::setUrl(const KUrl& url)
 {
 
 void StatusBarSpaceInfo::setUrl(const KUrl& url)
 {
@@ -83,7 +82,7 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
         painter.setPen(Qt::NoPen);
         painter.setBrush(progressColor(backgrColor));
         int usedWidth = barWidth - static_cast<int>((m_kBAvailable *
         painter.setPen(Qt::NoPen);
         painter.setBrush(progressColor(backgrColor));
         int usedWidth = barWidth - static_cast<int>((m_kBAvailable *
-                                                    static_cast<float>(barWidth)) / m_kBSize);
+                        static_cast<float>(barWidth)) / m_kBSize);
         const int left = 1;
         int right = usedWidth - widthDec;
         if (right < left) {
         const int left = 1;
         int right = usedWidth - widthDec;
         if (right < left) {
@@ -92,12 +91,10 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
         painter.drawRect(QRect(left, barTop + 2, right, barHeight - 1));
 
         text = i18n("%1% of %2 used", 100 - (int)(100.0 * m_kBAvailable / m_kBSize), KIO::convertSizeFromKiB(m_kBSize));
         painter.drawRect(QRect(left, barTop + 2, right, barHeight - 1));
 
         text = i18n("%1% of %2 used", 100 - (int)(100.0 * m_kBAvailable / m_kBSize), KIO::convertSizeFromKiB(m_kBSize));
-    }
-    else {
+    } else {
         if (m_gettingSize) {
             text = i18n("Getting size...");
         if (m_gettingSize) {
             text = i18n("Getting size...");
-        }
-        else {
+        } else {
             text = QString();
             QTimer::singleShot(0, this, SLOT(hide()));
         }
             text = QString();
             QTimer::singleShot(0, this, SLOT(hide()));
         }
@@ -112,9 +109,9 @@ void StatusBarSpaceInfo::paintEvent(QPaintEvent* /* event */)
 
 
 void StatusBarSpaceInfo::slotFoundMountPoint(const unsigned long& kBSize,
 
 
 void StatusBarSpaceInfo::slotFoundMountPoint(const unsigned long& kBSize,
-                                             const unsigned long& /* kBUsed */,
-                                             const unsigned long& kBAvailable,
-                                             const QString& /* mountPoint */)
+        const unsigned long& /* kBUsed */,
+        const unsigned long& kBAvailable,
+        const QString& /* mountPoint */)
 {
     m_gettingSize = false;
     m_kBSize = kBSize;
 {
     m_gettingSize = false;
     m_kBSize = kBSize;
@@ -150,11 +147,11 @@ void StatusBarSpaceInfo::refresh()
     connect(job, SIGNAL(foundMountPoint(const unsigned long&,
                                         const unsigned long&,
                                         const unsigned long&,
     connect(job, SIGNAL(foundMountPoint(const unsigned long&,
                                         const unsigned long&,
                                         const unsigned long&,
-                                        const QString& )),
+                                        const QString&)),
             this, SLOT(slotFoundMountPoint(const unsigned long&,
                                            const unsigned long&,
                                            const unsigned long&,
             this, SLOT(slotFoundMountPoint(const unsigned long&,
                                            const unsigned long&,
                                            const unsigned long&,
-                                           const QString& )));
+                                           const QString&)));
     connect(job, SIGNAL(done()),
             this, SLOT(showResult()));
 
     connect(job, SIGNAL(done()),
             this, SLOT(showResult()));
 
index bfa1156c3f6dd6b10dfc6436af63cc82ded13fa7..0b69244663d65da2ee74be25fa59cd638b60b307 100644 (file)
@@ -42,7 +42,10 @@ public:
     virtual ~StatusBarSpaceInfo();
 
     void setUrl(const KUrl& url);
     virtual ~StatusBarSpaceInfo();
 
     void setUrl(const KUrl& url);
-    const KUrl& url() const { return m_url; }
+    const KUrl& url() const
+    {
+        return m_url;
+    }
 
 protected:
     /** @see QWidget::paintEvent() */
 
 protected:
     /** @see QWidget::paintEvent() */
index 48d75b5bcaf5fc9f6f64994ff4aacf4c48957d4d..eae68c67b1c35f357998756396147757ff7f94e3 100644 (file)
 #include <QClipboard>
 
 TreeViewContextMenu::TreeViewContextMenu(QWidget* parent,
 #include <QClipboard>
 
 TreeViewContextMenu::TreeViewContextMenu(QWidget* parent,
-                                         KFileItem* fileInfo) :
-    m_parent(parent),
-    m_fileInfo(fileInfo)
-{
-}
+        KFileItem* fileInfo) :
+        m_parent(parent),
+        m_fileInfo(fileInfo)
+{}
 
 TreeViewContextMenu::~TreeViewContextMenu()
 
 TreeViewContextMenu::~TreeViewContextMenu()
-{
-}
+{}
 
 void TreeViewContextMenu::open()
 {
 
 void TreeViewContextMenu::open()
 {
@@ -82,8 +80,7 @@ void TreeViewContextMenu::open()
         QAction* moveToTrashAction = new QAction(KIcon("edit-trash"), i18n("Move To Trash"), this);
         connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
         popup->addAction(moveToTrashAction);
         QAction* moveToTrashAction = new QAction(KIcon("edit-trash"), i18n("Move To Trash"), this);
         connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
         popup->addAction(moveToTrashAction);
-    }
-    else {
+    } else {
         showDeleteCommand = true;
     }
 
         showDeleteCommand = true;
     }
 
@@ -132,8 +129,7 @@ void TreeViewContextMenu::paste()
     if (KonqMimeData::decodeIsCutSelection(mimeData)) {
         KonqOperations::copy(m_parent, KonqOperations::MOVE, source, dest);
         clipboard->clear();
     if (KonqMimeData::decodeIsCutSelection(mimeData)) {
         KonqOperations::copy(m_parent, KonqOperations::MOVE, source, dest);
         clipboard->clear();
-    }
-    else {
+    } else {
         KonqOperations::copy(m_parent, KonqOperations::COPY, source, dest);
     }
 }
         KonqOperations::copy(m_parent, KonqOperations::COPY, source, dest);
     }
 }
index 0951171198626048f39a076eee845f6920e410e2..8c746a253f5cc52662f83ea2465f2b03cbfd8ffd 100644 (file)
 #include "dolphinsettings.h"
 
 TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) :
 #include "dolphinsettings.h"
 
 TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) :
-    SidebarPage(parent),
-    m_dirLister(0),
-    m_dirModel(0),
-    m_proxyModel(0),
-    m_treeView(0)
+        SidebarPage(parent),
+        m_dirLister(0),
+        m_dirModel(0),
+        m_proxyModel(0),
+        m_treeView(0)
 {
     m_dirLister = new KDirLister();
     m_dirLister->setDirOnlyMode(true);
 {
     m_dirLister = new KDirLister();
     m_dirLister->setDirOnlyMode(true);
@@ -105,8 +105,7 @@ void TreeViewSidebarPage::setUrl(const KUrl& url)
         const QModelIndex proxyIndex = m_proxyModel->mapFromSource(index);
         m_treeView->scrollTo(proxyIndex);
         selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
         const QModelIndex proxyIndex = m_proxyModel->mapFromSource(index);
         m_treeView->scrollTo(proxyIndex);
         selModel->setCurrentIndex(proxyIndex, QItemSelectionModel::Select);
-    }
-    else {
+    } else {
         // The item with the given URL is not loaded by the model yet. Iterate
         // backward to the base URL and trigger the loading of the items for
         // each hierarchy level.
         // The item with the given URL is not loaded by the model yet. Iterate
         // backward to the base URL and trigger the loading of the items for
         // each hierarchy level.
index 5d652281a14c8e9c1f55ef4a50325a71c7bbc226..485ed438498f6a8146bfe40e72c89d9721318ab8 100644 (file)
@@ -37,9 +37,9 @@
 #define FILE_NAME "/.directory"
 
 ViewProperties::ViewProperties(const KUrl& url) :
 #define FILE_NAME "/.directory"
 
 ViewProperties::ViewProperties(const KUrl& url) :
-      m_changedProps(false),
-      m_autoSave(true),
-      m_node(0)
+        m_changedProps(false),
+        m_autoSave(true),
+        m_node(0)
 {
     KUrl cleanUrl(url);
     cleanUrl.cleanPath();
 {
     KUrl cleanUrl(url);
     cleanUrl.cleanPath();
@@ -57,14 +57,12 @@ ViewProperties::ViewProperties(const KUrl& url) :
     const bool useGlobalViewProps = settings->globalViewProps();
     if (useGlobalViewProps) {
         m_filepath = destinationDir("global");
     const bool useGlobalViewProps = settings->globalViewProps();
     if (useGlobalViewProps) {
         m_filepath = destinationDir("global");
-    }
-    else if (cleanUrl.isLocalFile()) {
+    } else if (cleanUrl.isLocalFile()) {
         const QFileInfo info(m_filepath);
         if (!info.isWritable()) {
             m_filepath = destinationDir("local") + m_filepath;
         }
         const QFileInfo info(m_filepath);
         if (!info.isWritable()) {
             m_filepath = destinationDir("local") + m_filepath;
         }
-    }
-    else {
+    } else {
         m_filepath = destinationDir("remote") + m_filepath;
     }
 
         m_filepath = destinationDir("remote") + m_filepath;
     }
 
index faaffc6cc1ebeba0819430b6067e58796a4ff583..9a721e2bc2c15dabea5deec0b495594d87fb89a6 100644 (file)
 #include <QVBoxLayout>
 
 ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
 #include <QVBoxLayout>
 
 ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
-    KDialog(dolphinView),
-    m_isDirty(false),
-    m_dolphinView(dolphinView),
-    m_viewProps(0),
-    m_viewMode(0),
-    m_sorting(0),
-    m_sortOrder(0),
-    m_additionalInfo(0),
-    m_showPreview(0),
-    m_showHiddenFiles(0),
-    m_applyToCurrentFolder(0),
-    m_applyToSubFolders(0),
-    m_useAsDefault(0)
+        KDialog(dolphinView),
+        m_isDirty(false),
+        m_dolphinView(dolphinView),
+        m_viewProps(0),
+        m_viewMode(0),
+        m_sorting(0),
+        m_sortOrder(0),
+        m_additionalInfo(0),
+        m_showPreview(0),
+        m_showHiddenFiles(0),
+        m_applyToCurrentFolder(0),
+        m_applyToSubFolders(0),
+        m_useAsDefault(0)
 {
     Q_ASSERT(dolphinView != 0);
     const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
 {
     Q_ASSERT(dolphinView != 0);
     const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
@@ -162,7 +162,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
         m_applyToCurrentFolder = new QRadioButton(i18n("Current folder"), applyBox);
         m_applyToCurrentFolder->setChecked(true);
         m_applyToSubFolders = new QRadioButton(i18n("Current folder including all sub folders"), applyBox);
         m_applyToCurrentFolder = new QRadioButton(i18n("Current folder"), applyBox);
         m_applyToCurrentFolder->setChecked(true);
         m_applyToSubFolders = new QRadioButton(i18n("Current folder including all sub folders"), applyBox);
-        m_applyToAllFolders = new QRadioButton(i18n("All folders"),applyBox);
+        m_applyToAllFolders = new QRadioButton(i18n("All folders"), applyBox);
 
         QButtonGroup* applyGroup = new QButtonGroup(this);
         applyGroup->addButton(m_applyToCurrentFolder);
 
         QButtonGroup* applyGroup = new QButtonGroup(this);
         applyGroup->addButton(m_applyToCurrentFolder);
@@ -237,10 +237,10 @@ void ViewPropertiesDialog::slotAdditionalInfoChanged(int index)
 {
     KFileItemDelegate::AdditionalInformation info = KFileItemDelegate::NoInformation;
     switch (index) {
 {
     KFileItemDelegate::AdditionalInformation info = KFileItemDelegate::NoInformation;
     switch (index) {
-        case 1:  info = KFileItemDelegate::FriendlyMimeType; break;
-        case 2:  info = KFileItemDelegate::Size; break;
-        case 3:  info = KFileItemDelegate::ModificationTime; break;
-        default: break;
+    case 1:  info = KFileItemDelegate::FriendlyMimeType; break;
+    case 2:  info = KFileItemDelegate::Size; break;
+    case 3:  info = KFileItemDelegate::ModificationTime; break;
+    default: break;
     }
     m_viewProps->setAdditionalInfo(info);
     m_isDirty = true;
     }
     m_viewProps->setAdditionalInfo(info);
     m_isDirty = true;
@@ -277,8 +277,8 @@ void ViewPropertiesDialog::applyViewProperties()
         }
 
         ViewPropsProgressInfo* info = new ViewPropsProgressInfo(m_dolphinView,
         }
 
         ViewPropsProgressInfo* info = new ViewPropsProgressInfo(m_dolphinView,
-                                                                m_dolphinView->url(),
-                                                                *m_viewProps);
+                                      m_dolphinView->url(),
+                                      *m_viewProps);
         info->setWindowModality(Qt::NonModal);
         info->show();
     }
         info->setWindowModality(Qt::NonModal);
         info->show();
     }
index 61f6423c449588f1c481f5cdfcc374f0739e1f7c..e0037a6f94a417a0cd21daa36f6200f4b32b9607 100644 (file)
 #include <kio/jobclasses.h>
 
 ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
 #include <kio/jobclasses.h>
 
 ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
-                                             const KUrl& dir,
-                                             const ViewProperties& viewProps) :
-    KDialog(parent),
-    m_dir(dir),
-    m_viewProps(0),
-    m_label(0),
-    m_progressBar(0),
-    m_dirSizeJob(0),
-    m_applyViewPropsJob(0),
-    m_timer(0)
+        const KUrl& dir,
+        const ViewProperties& viewProps) :
+        KDialog(parent),
+        m_dir(dir),
+        m_viewProps(0),
+        m_label(0),
+        m_progressBar(0),
+        m_dirSizeJob(0),
+        m_applyViewPropsJob(0),
+        m_timer(0)
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(320, minSize.height()));
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(320, minSize.height()));
index 019c83afe7304b66ecc6799df722eefa37788bf2..bef99bacc732b1ce525ab4d3b8b4e4165384767e 100644 (file)
 
 ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow,
                                    QWidget* parent) :
 
 ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow,
                                    QWidget* parent) :
-    SettingsPageBase(parent),
-    m_generalPage(0),
-    m_iconsPage(0),
-    m_detailsPage(0),
-    m_columnPage(0)
+        SettingsPageBase(parent),
+        m_generalPage(0),
+        m_iconsPage(0),
+        m_detailsPage(0),
+        m_columnPage(0)
 {
     QVBoxLayout* topLayout = new QVBoxLayout(this);
     topLayout->setMargin(0);
 {
     QVBoxLayout* topLayout = new QVBoxLayout(this);
     topLayout->setMargin(0);
@@ -68,8 +68,7 @@ ViewSettingsPage::ViewSettingsPage(DolphinMainWindow* mainWindow,
 }
 
 ViewSettingsPage::~ViewSettingsPage()
 }
 
 ViewSettingsPage::~ViewSettingsPage()
-{
-}
+{}
 
 void ViewSettingsPage::applySettings()
 {
 
 void ViewSettingsPage::applySettings()
 {