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

List:       kde-commits
Subject:    kdesdk/kbabel/catalogmanager
From:       Marco Wegner <dubbleu () web ! de>
Date:       2003-02-03 22:02:22
[Download RAW message or body]

CVS commit by mwegner: 

CCMAIL: kbabel@kde.org

- Fix: Make 'Update Marked Templates' and 'Commit Marked Templates' work.


  M +2 -2      catalogmanagerview.cpp   1.76
  M +11 -10    libcvs/cvshandler.cpp   1.7
  M +2 -3      libcvs/cvshandler.h   1.4


--- kdesdk/kbabel/catalogmanager/catalogmanagerview.cpp  #1.75:1.76
@@ -935,5 +935,5 @@ void CatalogManagerView::doCVSCommand( C
         fileList << i->poFile( );
     }
-    cvshandler->execCVSCommand( cmd, fileList );
+    cvshandler->execCVSCommand(cmd, fileList, templates);
   } else {
     QString basedir = ( templates ? _settings.potBaseDir : _settings.poBaseDir );
@@ -949,5 +949,5 @@ void CatalogManagerView::doCVSCommand( C
     }
     if ( !cvsItem.isEmpty( ) )
-      cvshandler->execCVSCommand( cmd, cvsItem );
+      cvshandler->execCVSCommand(cmd, cvsItem, templates);
   }
 }

--- kdesdk/kbabel/catalogmanager/libcvs/cvshandler.cpp  #1.6:1.7
@@ -173,10 +173,5 @@ QString CVSHandler::cvsStatus( const QSt
 }
 
-void CVSHandler::execCVSCommand( CVS::Command cmd )
-{
-  execCVSCommand( cmd, _poBaseDir );
-}
-
-void CVSHandler::execCVSCommand( CVS::Command cmd, const QString& filename )
+void CVSHandler::execCVSCommand(CVS::Command cmd, const QString& filename, bool templates)
 {
   if ( !_isPORepository ) {
@@ -189,5 +184,5 @@ void CVSHandler::execCVSCommand( CVS::Co
   QFileInfo info( filename );
   if ( !info.isDir( ) ) {
-    execCVSCommand( cmd, QStringList( filename ) );
+    execCVSCommand(cmd, QStringList( filename ), templates);
     return;
   }
@@ -211,5 +206,5 @@ void CVSHandler::execCVSCommand( CVS::Co
 }
 
-void CVSHandler::execCVSCommand( CVS::Command cmd, const QStringList& files )
+void CVSHandler::execCVSCommand(CVS::Command cmd, const QStringList& files, bool templates)
 {
   if ( !_isPORepository ) {
@@ -221,5 +216,5 @@ void CVSHandler::execCVSCommand( CVS::Co
 
   QStringList::ConstIterator it;
-  QString command( "cd " + _poBaseDir + " && cvs " );
+  QString command("cd " + (templates ? _potBaseDir : _poBaseDir) + " && cvs ");
   switch ( cmd ) {
     case CVS::Update:
@@ -235,7 +230,13 @@ void CVSHandler::execCVSCommand( CVS::Co
   }
 
+  QRegExp rx;
+  if (templates)
+    rx.setPattern(_potBaseDir + "/?");
+  else
+    rx.setPattern(_poBaseDir + "/?");
+
   for ( it = files.begin( ); it != files.end( ); ++it ) {
     QString temp = *it;
-    temp.remove( QRegExp( _poBaseDir + "/?" ) );
+    temp.remove(rx);
     command += " \'" + temp + "\'";
   }

--- kdesdk/kbabel/catalogmanager/libcvs/cvshandler.h  #1.3:1.4
@@ -64,7 +64,6 @@ class CVSHandler : public QObject
     QString cvsStatus( const QString& filename ) const;
 
-    void execCVSCommand( CVS::Command cmd );
-    void execCVSCommand( CVS::Command cmd, const QString& filename );
-    void execCVSCommand( CVS::Command cmd, const QStringList& files );
+    void execCVSCommand(CVS::Command cmd, const QString& filename, bool templates = false);
+    void execCVSCommand(CVS::Command cmd, const QStringList& files, bool templates = false);
     
     void setAutoUpdateTemplates( bool update );


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

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