Bug 132530

Summary: Quanta displays 'Search in Files' menu item even if KFileReplace not existent
Product: quanta Reporter: Samir M. Nassar <bugzilla>
Component: generalAssignee: András Manţia <amantia>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Samir M. Nassar 2006-08-17 05:28:37 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages
Compiler:          GCC 4.1.1 
OS:                Linux

Under the 'Edit' Menu there is an entry called 'Find in Files' which is active and available even though KFileReplace, the app it calls, is not installed.

Expected behaviour would be for the menu item to not appear if the application it depends on isn't installed.

In general Quanta has unexpected behaviour with regards to its plugins. The 'plugins' are standalone applications that would be better served being Quanta plugins. Alternatively there could be standalone applications in addition to standalone Quanta plugins. Perhaps more like the Kontact framework interacts with KMail. As it is Quanta 'expects' the applications to be there. This expectation isn't being served by Quantas architecture which doesn't make those apps clear dependencies.
Comment 1 András Manţia 2006-09-02 12:44:15 UTC
SVN commit 579993 by amantia:

Do not show Find in Files menu if KFileReplace is not installed.

BUG: 132530

 M  +1 -0      ChangeLog  
 M  +7 -1      src/quanta_init.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #579992:579993
@@ -11,6 +11,7 @@
       - fix crash when copying to clipboard inside VPL [#130212]
       - show the correct column number if tabs are used in the document [#133313]
       - only one upload dialog can be shown at any time [#132535]
+      - do not show Find in Files if KFileReplace is not installed
 
 Version 3.5.4 (Release date: 02-08-2006; Started 24-06-2005):
  - bugfixes:
--- branches/KDE/3.5/kdewebdev/quanta/src/quanta_init.cpp #579992:579993
@@ -1093,6 +1093,12 @@
           m_quanta, SLOT(slotHideSplash()));
   connect(m_quanta->m_pluginInterface, SIGNAL(statusMsg(const QString &)),
           m_quanta, SLOT(slotStatusMsg(const QString & )));
+
+  QuantaPlugin *fileReplacePlugin =m_quanta-> m_pluginInterface->plugin("KFileReplace");
+  if (!fileReplacePlugin)
+  {
+    delete m_quanta->actionCollection()->action("find_in_files");
+  }
 }
 
 
@@ -1423,7 +1429,7 @@
   dependency.type = Dependency::Executable;
   dependencies.append(dependency);
 
-  dependency.name = "KFileReplace)";
+  dependency.name = "KFileReplace";
   dependency.execName = "KFileReplace";
   dependency.url = "http://kfilereplace.kdewebdev.org";
   dependency.description = i18n("search and replace in files");
Comment 2 András Manţia 2006-09-02 12:46:47 UTC
I fixed the problem now. But an explanation regarding Quanta's plugins.
They are just KParts, nothing Quanta specific like in case of KOffice or 
Kontact. 
For many of such KParts there is a standalone application as well, 
acting as a shell around the part. This is the case of KFileReplace, 
KImageMapEditor, KLinkStatus, Cervisia and many other applications. 
So there *are* standalone applications for the plugins itself, just that 
Quanta is able to run the part instead of application, having this way 
a more pleasant integration of two different applications.
Oh, and Quanta warns on startup if an important plugin is missing.
Comment 3 András Manţia 2006-10-18 11:25:30 UTC
SVN commit 596711 by amantia:

Regression fix: show the Find in Files when KFileReplace is installed. Was broken due to the commit for #132530.

CCBUG: 132530

 M  +5 -1      ChangeLog  
 M  +3 -6      quanta.kdevelop  
 M  +2 -4      src/quanta_init.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #596710:596711
@@ -1,7 +1,11 @@
 This files contains the changes since Quanta 2.0 until the current 3.5.x series.
 
-Version 3.5.5 (Release date: xx-10-2006; Started 01-09-2006):
+Version 3.5.6 (Release date: xx-xx-2006; Started 01-09-2006):
  - bugfixes:
+      - show Find in Files menu if KFileReplace is installed [related to #132530]
+
+Version 3.5.5 (Release date: 11-10-2006; Started 01-09-2006):
+ - bugfixes:
       - do not allow growing of quantarc until it crashes Quanta [#111049]
       - symlink handling fixes (hopefully won't break anything)
       - fix Save As problems, possibly #131728
--- branches/KDE/3.5/kdewebdev/quanta/quanta.kdevelop #596710:596711
@@ -245,10 +245,10 @@
   </kdevcvs>
   <kdevfilecreate>
     <filetypes>
-      <type icon="" ext="h" create="template" name="C++ header" >
+      <type icon="" ext="h" name="C++ header" create="template" >
         <descr>Quanta speicfic header</descr>
       </type>
-      <type icon="source_cpp" ext="cpp" create="template" name="C++ source" >
+      <type icon="source_cpp" ext="cpp" name="C++ source" create="template" >
         <descr>A new empty C++ file.</descr>
       </type>
     </filetypes>
@@ -275,10 +275,7 @@
       <processPrimaryTypes>true</processPrimaryTypes>
       <processFunctionArguments>false</processFunctionArguments>
     </codecompletion>
-    <references>
-      <pcs>Qt3</pcs>
-      <pcs>KDElibs3</pcs>
-    </references>
+    <references/>
     <creategettersetter>
       <prefixGet/>
       <prefixSet>set</prefixSet>
--- branches/KDE/3.5/kdewebdev/quanta/src/quanta_init.cpp #596710:596711
@@ -176,8 +176,6 @@
           m_quanta->m_debugger, SLOT(slotHandleEvent(const QString &, const QString &, const QString &)));
   connect(m_quanta->m_debugger, SIGNAL(hideSplash()), m_quanta, SLOT(slotHideSplash()));
 
-  m_quanta->m_pluginInterface->readConfig(); //call here, so the plugin actions are created before the GUI
-
   //m_quanta->KDockMainWindow::createGUI( QString::null, false /* conserveMemory */ );
   m_quanta->createShellGUI(true);
 
@@ -1094,8 +1092,8 @@
   connect(m_quanta->m_pluginInterface, SIGNAL(statusMsg(const QString &)),
           m_quanta, SLOT(slotStatusMsg(const QString & )));
 
-  QuantaPlugin *fileReplacePlugin =m_quanta-> m_pluginInterface->plugin("KFileReplace");
-  if (!fileReplacePlugin)
+  m_quanta->m_pluginInterface->readConfig();
+  if (!m_quanta->m_pluginInterface->pluginAvailable("KFileReplace"))
   {
     delete m_quanta->actionCollection()->action("find_in_files");
   }