Updated htaccess to Apache 2.4 compat
[biaweb_qt.git] / main_window.py
index 8963536..57762af 100644 (file)
@@ -23,7 +23,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow):
                recs = biaweb_db.get_categories (self.current_db)
 
                # check with False because None is returned when no records exist
-               if recs == False:
+               if recs is False:
                        PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the categories")
                        return False
 
@@ -40,7 +40,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow):
                recs = biaweb_db.get_articles (self.current_db, catid)
 
                # check with False because None is returned when no records exist
-               if recs == False:
+               if recs is False:
                        PyQt4.QtGui.QMessageBox.critical (self, "Error", "SQLite 3 error in getting the articles")
                        return False
 
@@ -49,6 +49,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow):
                        qrow = PyQt4.QtGui.QTreeWidgetItem ([str(item[0]), str(item[1])])
                        self.articles.addTopLevelItem (qrow)
                # return true when successful
+               return True
 
        # when the view is refreshed
        def onViewRefresh (self):
@@ -341,7 +342,7 @@ class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow):
                        loaded_arts = self.repopulate_articles ()
                        # if failed in loading either categories or articles (note: checking against
                        # False and not None)
-                       if loaded_cats == False or loaded_arts == False:
+                       if loaded_cats is False or loaded_arts is False:
                                self.current_db = None
                                PyQt4.QtGui.QMessageBox.critical (self, "Error",
                                        "SQLite 3 error in loading site database. This appears to be an invalid BiaWeb database")