Summary: | Important settings in projects are silently overriden by default projects settings | ||
---|---|---|---|
Product: | [Unmaintained] kbabel | Reporter: | Yury Tarasievich <yury_tarasievich> |
Component: | CatalogManager | Assignee: | Stanislav Visnovsky <visnovsky> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Find/Replace is now open with the project file opened in catalogmanager |
Description
Yury Tarasievich
2005-11-29 23:46:39 UTC
This is due to an insufficient dcop interface for "find in files" and "replace in files". KBabel does not get the current project from catalogmanager and starts using the default project. The dcop interface has to be changed accordingly. Created attachment 18989 [details]
Find/Replace is now open with the project file opened in catalogmanager
This patch adds two dcop calls for findInFile and replaceInFile where the
caller (catalogmanager in this case) passes the project name to the receiver.
This way kbabel does not start with the default project but with the same
project catalogmanager has opened.
SVN commit 616403 by johach: Use the same project for all Find/Replace in Files operations as catalogmanager. BUG:117308 M +14 -2 catalogmanager/catalogmanager.cpp M +8 -0 kbabel/kbabeliface.h M +35 -2 kbabel/main.cpp --- branches/KDE/3.5/kdesdk/kbabel/catalogmanager/catalogmanager.cpp #616402:616403 @@ -958,6 +958,7 @@ { if( startKBabel() ) { + QCString funcCall("findInFile(QCString,QCString,QString,int,int,int,int,int,int,int,int,int,int)"); DCOPClient *client = kapp->dcopClient(); QByteArray data; QDataStream arg(data, IO_WriteOnly); @@ -974,8 +975,13 @@ arg << (_findOptions.ignoreContextInfo ? 1 : 0); arg << (_findOptions.askForNextFile ? 1 : 0); arg << (_findOptions.askForSave ? 1 : 0); + if(_configFile != "kbabelrc" ) { + arg << _configFile.utf8(); + funcCall="findInFile(QCString,QCString,QString,int,int,int,int,int,int,int,int,int,int,QCString)"; + } + kdDebug(KBABEL) << "DCOP: " << QString(data.data()) << endl; if( !client->send("kbabel","KBabelIFace", - "findInFile(QCString,QCString,QString,int,int,int,int,int,int,int,int,int,int)", data) + funcCall, data) ) { KMessageBox::error( this, i18n("DCOP communication with KBabel failed."), i18n("DCOP Communication Error")); stopSearching(); @@ -1037,9 +1043,11 @@ { if( startKBabel() ) { + QCString funcCall("replaceInFile(QCString,QCString,QString,QString,int,int,int,int,int,int,int,int,int,int,int)"); DCOPClient *client = kapp->dcopClient(); QByteArray data; QDataStream arg(data, IO_WriteOnly); + arg << client->appId(); arg << url.utf8(); arg << options.findStr; @@ -1055,8 +1063,12 @@ arg << (options.ask ? 1 : 0); arg << (options.askForNextFile ? 1 : 0); arg << (options.askForSave ? 1 : 0); + if(_configFile != "kbabelrc" ) { + arg << _configFile.utf8(); + funcCall="replaceInFile(QCString,QCString,QString,QString,int,int,int,int,int,int,int,int,int,int,int,QCString)"; + } if( !client->send("kbabel","KBabelIFace", - "replaceInFile(QCString,QCString,QString,QString,int,int,int,int,int,int,int,int,int,int,int)", data) + funcCall, data) ) { KMessageBox::error( this, i18n("DCOP communication with KBabel failed."), i18n("DCOP Communication Error")); stopSearching(); --- branches/KDE/3.5/kdesdk/kbabel/kbabel/kbabeliface.h #616402:616403 @@ -67,6 +67,14 @@ QString findStr, QString replaceStr, int caseSensitive, int wholeWords, int isRegExp, int inMsgid, int inMsgstr, int inComment, int ignoreAccelMarker, int ignoreContextInfo, int ask, int askForNextFile, int askForSave)=0; + virtual bool findInFile(QCString fileSource, QCString url, + QString findStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, + int ignoreAccelMarker, int ignoreContextInfo, int askForNextFile, int askForSave, QCString project )=0; + virtual bool replaceInFile(QCString fileSource, QCString url, + QString findStr, QString replaceStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, int ignoreAccelMarker, + int ignoreContextInfo, int ask, int askForNextFile, int askForSave, QCString project )=0; virtual void spellcheck(QStringList fileList)=0; }; --- branches/KDE/3.5/kdesdk/kbabel/kbabel/main.cpp #616402:616403 @@ -73,6 +73,14 @@ QString findStr, QString replaceStr, int caseSensitive, int wholeWords, int isRegExp, int inMsgid, int inMsgstr, int inComment, int ignoreAccelMarker, int ignoreContextInfo, int ask, int askForNextFile, int askForSave); + virtual bool findInFile(QCString fileSource, QCString url, + QString findStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, + int ignoreAccelMarker, int ignoreContextInfo, int askForNextFile, int askForSave, QCString project ); + virtual bool replaceInFile(QCString fileSource, QCString url, + QString findStr, QString replaceStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, + int ignoreAccelMarker, int ignoreContextInfo, int ask, int askForNextFile, int askForSave, QCString project ); virtual void spellcheck(QStringList fileList); private: KBabelMW* findInstance( const KURL& url, const QString& project, const QString& package) const; @@ -393,10 +401,22 @@ int inMsgid, int inMsgstr, int inComment, int ignoreAccelMarker, int ignoreContextInfo, int askForNextFile, int askForSave) { + // no project given, open with default project + return findInFile ( fileSource, url, findStr, caseSensitive, + wholeWords, isRegExp, inMsgid, inMsgstr, inComment, ignoreAccelMarker, ignoreContextInfo, + askForNextFile, askForSave, + KBabel::ProjectManager::defaultProjectName().utf8() ); +} + +bool KBabelInterface::findInFile(QCString fileSource, QCString url, + QString findStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, + int ignoreAccelMarker, int ignoreContextInfo, int askForNextFile, int askForSave, QCString project ) +{ kdDebug(KBABEL) << "findInFile (" <<fileSource<< "): " << url << " for " << findStr << endl; const KURL u( QString::fromLocal8Bit( url ) ); - KBabelMW *kb = findInstance( u, KBabel::ProjectManager::defaultProjectName(), QString() ); + KBabelMW *kb = findInstance( u, QString::fromLocal8Bit(project), QString() ); if(!kb) return false; @@ -424,10 +444,23 @@ int inMsgid, int inMsgstr, int inComment, int ignoreAccelMarker, int ignoreContextInfo, int ask, int askForNextFile, int askForSave) { + return replaceInFile( fileSource, url, + findStr, replaceStr, caseSensitive, wholeWords, isRegExp, + inMsgid, inMsgstr, inComment, ignoreAccelMarker, ignoreContextInfo, + ask, askForNextFile, askForSave, + KBabel::ProjectManager::defaultProjectName().utf8() ); +} + +bool KBabelInterface::replaceInFile(QCString fileSource, QCString url, + QString findStr, QString replaceStr, int caseSensitive, int wholeWords, int isRegExp, + int inMsgid, int inMsgstr, int inComment, + int ignoreAccelMarker, int ignoreContextInfo, int ask, int askForNextFile, int askForSave, + QCString project ) +{ kdDebug(KBABEL) << "replaceInFile (" <<fileSource<< "): " << url << " for " << findStr << endl; const KURL u ( QString::fromLocal8Bit( url ) ); - KBabelMW *kb = findInstance( u, KBabel::ProjectManager::defaultProjectName(), QString() ); + KBabelMW *kb = findInstance( u, QString::fromLocal8Bit(project), QString() ); if( !kb ) return false; |