diff -aur catfish-1.2.2/catfish/CatfishWindow.py catfish-1.2.2.new/catfish/CatfishWindow.py --- catfish-1.2.2/catfish/CatfishWindow.py 2014-10-12 13:55:12.152362617 +0300 +++ catfish-1.2.2.new/catfish/CatfishWindow.py 2014-10-12 13:56:16.050600001 +0300 @@ -34,7 +34,7 @@ import logging logger = logging.getLogger('catfish') -from catfish_lib import Window, CatfishSettings, SudoDialog, helpers +from catfish_lib import catfishconfig, Window, CatfishSettings, SudoDialog, helpers from catfish.AboutCatfishDialog import AboutCatfishDialog from catfish.CatfishSearchEngine import * @@ -226,7 +226,9 @@ locate, locate_path, locate_date = self.check_locate() self.update_index_database.set_label("%s" % locate_path) - if os.path.isfile(locate_path): + if not os.access(os.path.dirname(locate_path), os.R_OK): + modified = _("Unknown") + elif os.path.isfile(locate_path): modified = locate_date.strftime("%x %X") else: modified = _("Never") @@ -452,8 +454,10 @@ return None path = os.path.realpath(path) locate = os.path.basename(path) - db = os.path.join('/var/lib', locate, locate + '.db') - if os.path.isfile(db): + db = catfishconfig.get_locate_db_path() + if not os.access(os.path.dirname(db), os.R_OK): + modified = time.time() + elif os.path.isfile(db): modified = os.path.getmtime(db) else: modified = 0 diff -aur catfish-1.2.2/catfish_lib/catfishconfig.py catfish-1.2.2.new/catfish_lib/catfishconfig.py --- catfish-1.2.2/catfish_lib/catfishconfig.py 2014-10-12 13:55:12.155696032 +0300 +++ catfish-1.2.2.new/catfish_lib/catfishconfig.py 2014-10-12 13:56:36.334431598 +0300 @@ -20,11 +20,14 @@ 'project_path_not_found', 'get_data_file', 'get_data_path', + 'get_locate_db_path', ] # Where your project will look for your data (for instance, images and ui # files). By default, this is ../data, relative your trunk layout __catfish_data_directory__ = '../data/' +# Location of locate.db file +__locate_db_path__ = '/var/lib/mlocate/mlocate.db' __license__ = 'GPL-2' __version__ = '1.2.2' @@ -64,6 +67,12 @@ return abs_data_path +def get_locate_db_path(): + """Return the location of the locate.db file + """ + return __locate_db_path__ + + def get_version(): """Return the program version number.""" return __version__