[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/kate
From:       Joseph Wenninger <kde () jowenn ! at>
Date:       2006-01-31 22:46:16
Message-ID: 1138747576.041525.7136.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 504392 by jowenn:

compile with explicit KSharedPtr constructor

 M  +1 -1      app/kateapp.cpp  
 M  +7 -7      app/katesession.cpp  
 M  +11 -12    plugins/filebrowser/katefileselector.cpp  


--- trunk/KDE/kdebase/kate/app/kateapp.cpp #504391:504392
@@ -146,7 +146,7 @@
   // activate again correct session!!!
   sessionConfig()->setGroup("General");
   QString lastSession (sessionConfig()->readEntry ("Last Session", \
                "default.katesession"));
-  sessionManager()->activateSession (new KateSession (sessionManager(), lastSession, \
""), false, false, false); +  sessionManager()->activateSession \
(KSharedPtr<KateSession>(new KateSession (sessionManager(), lastSession, "")), false, \
false, false);  
   m_docManager->restoreDocumentList (sessionConfig());
 
--- trunk/KDE/kdebase/kate/app/katesession.cpp #504391:504392
@@ -236,7 +236,7 @@
   for (unsigned int i=0; i < dir.count(); ++i)
   {
     KateSession *session = new KateSession (this, dir[i], "");
-    m_sessionList.append (session);
+    m_sessionList.append (KateSession::Ptr(session));
 
     kdDebug () << "FOUND SESSION: " << session->sessionName() << " FILE: " << \
session->sessionFile() << endl;  
@@ -246,7 +246,7 @@
 
   // add default session, if not there
   if (!foundDefault)
-    m_sessionList.append (new KateSession (this, "default.katesession", \
i18n("Default Session"))); +    m_sessionList.append (KSharedPtr<KateSession>(new \
KateSession (this, "default.katesession", i18n("Default Session"))));  }
 
 void KateSessionManager::activateSession (KateSession::Ptr session, bool closeLast, \
bool saveLast, bool loadNew) @@ -337,7 +337,7 @@
 KateSession::Ptr KateSessionManager::giveSession (const QString &name)
 {
   if (name.isEmpty())
-    return new KateSession (this, "", "");
+    return KateSession::Ptr(new KateSession (this, "", ""));
     
   updateSessionList();
 
@@ -440,14 +440,14 @@
   // uhh, just open last used session, show no chooser
   if (sesStart == "last")
   {
-    activateSession (new KateSession (this, lastSession, ""), false, false);
+    activateSession (KateSession::Ptr(new KateSession (this, lastSession, "")), \
false, false);  return success;
   }
 
   // start with empty new session
   if (sesStart == "new")
   {
-    activateSession (new KateSession (this, "", ""), false, false);
+    activateSession (KateSession::Ptr(new KateSession (this, "", "")), false, \
false);  return success;
   }
 
@@ -487,7 +487,7 @@
         break;
 
       default:
-        activateSession (new KateSession (this, "", ""), false, false);
+        activateSession (KateSession::Ptr(new KateSession (this, "", "")), false, \
false);  retry = false;
         break;
     }
@@ -513,7 +513,7 @@
 
 void KateSessionManager::sessionNew ()
 {
-  activateSession (new KateSession (this, "", ""));
+  activateSession (KateSession::Ptr(new KateSession (this, "", "")));
 }
 
 void KateSessionManager::sessionOpen ()
--- trunk/KDE/kdebase/kate/plugins/filebrowser/katefileselector.cpp #504391:504392
@@ -34,7 +34,7 @@
 #include <q3strlist.h>
 #include <qtooltip.h>
 #include <qapplication.h>
-#include <q3listbox.h>
+#include <QListWidget>
 #include <qscrollbar.h>
 #include <qspinbox.h>
 #include <q3groupbox.h>
@@ -72,6 +72,7 @@
 #include <ktexteditor/view.h>
 #include <kiconloader.h>
 #include <kglobal.h>
+#include <kfileitem.h>
 //END Includes
 
 
@@ -436,6 +437,7 @@
 void Kate::Private::Plugin::KateFileSelector::fileSelected(const KFileItem * \
/*file*/)  {
   const KFileItemList *list=dir->selectedItems();
+
   KFileItem *tmp;
   KFileItemList::const_iterator it = list->begin();
   const KFileItemList::const_iterator end = list->end();
@@ -594,10 +596,10 @@
 class ActionLBItem : public QListWidgetItem {
   public:
   ActionLBItem( QListWidget *lb=0,
-                const QPixmap &pm = QPixmap(),
-                const QString &text=QString(),
-                const QString &str=QString() ) :
-    QListWidgetItem( QIcon(pm), text, lb, 0 ),
+                const QIcon &pm = QIcon(),
+                const QString &text=QString::null,
+                const QString &str=QString::null ) :
+    QListWidgetItem(pm, text,lb,0 ),
     _str(str) {};
   QString idstring() { return _str; };
   private:
@@ -624,10 +626,10 @@
   acSel->setAvailableLabel( i18n("A&vailable actions:") );
   acSel->setSelectedLabel( i18n("S&elected actions:") );
   lo->addWidget( gbToolbar );
-  connect( acSel, SIGNAL( added( Q3ListBoxItem * ) ), this, SLOT( slotMyChanged() ) \
                );
-  connect( acSel, SIGNAL( removed( Q3ListBoxItem * ) ), this, SLOT( slotMyChanged() \
                ) );
-  connect( acSel, SIGNAL( movedUp( Q3ListBoxItem * ) ), this, SLOT( slotMyChanged() \
                ) );
-  connect( acSel, SIGNAL( movedDown( Q3ListBoxItem * ) ), this, SLOT( \
slotMyChanged() ) ); +  connect( acSel, SIGNAL( added( QListWidgetItem * ) ), this, \
SLOT( slotMyChanged() ) ); +  connect( acSel, SIGNAL( removed( QListWidgetItem * ) ), \
this, SLOT( slotMyChanged() ) ); +  connect( acSel, SIGNAL( movedUp( QListWidgetItem \
* ) ), this, SLOT( slotMyChanged() ) ); +  connect( acSel, SIGNAL( movedDown( \
QListWidgetItem * ) ), this, SLOT( slotMyChanged() ) );  
   // Sync
   Q3GroupBox *gbSync = new Q3GroupBox( 1, Qt::Horizontal, i18n("Auto \
Synchronization"), this ); @@ -725,10 +727,7 @@
   foreach(QListWidgetItem *item, list)
   {
     aItem = (ActionLBItem*)item;
-    if ( aItem )
-    {
       l << aItem->idstring();
-    }
   }
   config->writeEntry( "toolbar actions", l );
   fileSelector->setupToolbar( config );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic