Bug 49009 - Could Ark find unrar instead of rar?
Summary: Could Ark find unrar instead of rar?
Status: CLOSED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Helio Castro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-11 10:15 UTC by Thibaut Cousin
Modified: 2003-04-05 12:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaut Cousin 2002-10-11 10:15:32 UTC
Version:           v2.1.9 (using KDE 3.0.4)
Installed from:    SuSE
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:          Linux (i686) release 2.4.18-4GB

In most Linux systems I've seen, the executable file for managing RAR archives is "unrar", not "rar. Ark seems to be hard-coded for "rar".

Could you make if configurable or, better, make Ark look for both names when handling RAR archives, please? I know a symlink can solve the problem, but it's not user-friendly. ;-)

Thanks!
Comment 1 domseichter 2003-04-05 12:52:11 UTC
Subject: kdeutils/ark

CVS commit by domseichter: 

Fix for Bug 49009. If rar is not found unrar is used.

CCMAIL: 49009-done@bugs.kde.org


  M +13 -1     rar.cpp   1.14


--- kdeutils/ark/rar.cpp  #1.13:1.14
@@ -36,7 +36,9 @@
 // KDE includes
 #include <kdebug.h>
+#include <kglobal.h>
 #include <klocale.h>
 #include <kmessagebox.h>
 #include <kprocess.h>
+#include <kstddirs.h>
 
 // ark includes
@@ -53,6 +55,16 @@ RarArch::RarArch( ArkSettings *_settings
 {
   kdDebug(1601) << "RarArch constructor" << endl;
+
+  bool have_rar = !KGlobal::dirs()->findExe( "rar" ).isNull();
+  bool have_unrar = !KGlobal::dirs()->findExe( "unrar" ).isNull();
+
   m_archiver_program = "rar";
-  m_unarchiver_program = "rar"; // some distributions of rar don't have unrar (bug #7112)
+  m_unarchiver_program = "unrar";
+  if( !have_rar && have_unrar )
+          m_archiver_program = "unrar";
+
+  if( !have_unrar && have_rar )
+      m_unarchiver_program = "rar";
+      
   verifyUtilityIsAvailable(m_archiver_program, m_unarchiver_program);