]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
fixing more warnings
[dolphin.git] / src / dolphinmainwindow.cpp
index 938d41cbc5248c365d15038d754747b5655026e5..08773fac1c8c1332538ad2a00aa06dbef85ebef0 100644 (file)
 
 
 DolphinMainWindow::DolphinMainWindow() :
-    KMainWindow(0, "Dolphin"),
+    KMainWindow(0),
     m_splitter(0),
     m_activeView(0),
     m_clipboardContainsCutData(false)
 {
+    setObjectName("Dolphin");
     m_view[PrimaryIdx] = 0;
     m_view[SecondaryIdx] = 0;
 
@@ -458,7 +459,7 @@ void DolphinMainWindow::createFile()
     KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
     KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
 
-    const QString senderName(sender()->name());
+    const QString senderName(sender()->objectName());
     bool found = false;
     CreateFileEntry entry;
     while (!found && (it != end)) {
@@ -483,7 +484,7 @@ void DolphinMainWindow::createFile()
     QString sourcePath(entry.templatePath.left(pos + 1));
     sourcePath += KDesktopFile(entry.templatePath, true).readPathEntry("Url");
 
-    QString name(i18n(entry.name.ascii()));
+    QString name(i18n(entry.name.toAscii()));
     // Most entry names end with "..." (e. g. "HTML File..."), which is ok for
     // menus but no good choice for a new file name -> remove the dots...
     name.replace("...", QString::null);
@@ -589,20 +590,7 @@ void DolphinMainWindow::deleteItems()
 
 void DolphinMainWindow::properties()
 {
-    const KFileItemList* sourceList = m_activeView->selectedItems();
-    if (sourceList == 0) {
-        return;
-    }
-
-    KFileItemList list;
-    KFileItemList::const_iterator it = sourceList->begin();
-    const KFileItemList::const_iterator end = sourceList->end();
-    KFileItem* item = 0;
-    while (it != end) {
-        list.append(item);
-        ++it;
-    }
-
+    const KFileItemList list = m_activeView->selectedItems();
     new KPropertiesDialog(list, this);
 }
 
@@ -1461,8 +1449,8 @@ void DolphinMainWindow::updateHistory()
 
 void DolphinMainWindow::updateEditActions()
 {
-    const KFileItemList* list = m_activeView->selectedItems();
-    if ((list == 0) || (*list).isEmpty()) {
+    const KFileItemList list = m_activeView->selectedItems();
+    if (list.isEmpty()) {
         stateChanged("has_no_selection");
     }
     else {
@@ -1470,13 +1458,13 @@ void DolphinMainWindow::updateEditActions()
 
         KAction* renameAction = actionCollection()->action("rename");
         if (renameAction != 0) {
-            renameAction->setEnabled(list->count() >= 1);
+            renameAction->setEnabled(list.count() >= 1);
         }
 
         bool enableMoveToTrash = true;
 
-        KFileItemList::const_iterator it = list->begin();
-        const KFileItemList::const_iterator end = list->end();
+        KFileItemList::const_iterator it = list.begin();
+        const KFileItemList::const_iterator end = list.end();
         while (it != end) {
             KFileItem* item = *it;
             const KUrl& url = item->url();