@@ -563,7 +563,10 @@ def onAnimate(self):
563563 # Make sure that the toolbar does not extend beyond the desktop
564564 # Qt 4.3 does not show the toolbar at all if that happens...
565565 pos = self .windowAnimate .pos ()
566- desktopgeometry = QtWidgets .QApplication .desktop ().availableGeometry (sender )
566+ if hasattr (QtWidgets .QApplication , 'desktop' ):
567+ desktopgeometry = QtWidgets .QApplication .desktop ().availableGeometry (sender )
568+ else :
569+ desktopgeometry = sender .screen ().availableGeometry ()
567570 minx = desktopgeometry .left ()
568571 maxx = desktopgeometry .right ()- self .windowAnimate .frameGeometry ().width ()
569572 miny = desktopgeometry .top ()
@@ -945,7 +948,10 @@ def hideEvent(self,event):
945948 if self .settings ['WindowPosition/Maximized' ].getValue ():
946949 self .showMaximized ()
947950 elif self .settings ['WindowPosition/Width' ].getValue ():
948- desktoprct = QtWidgets .QApplication .desktop ().availableGeometry ()
951+ if hasattr (QtWidgets .QApplication , 'desktop' ):
952+ desktoprct = QtWidgets .QApplication .desktop ().availableGeometry ()
953+ else :
954+ desktoprct = self .screen ().availableGeometry ()
949955 w = min (desktoprct .width (), self .settings ['WindowPosition/Width' ].getValue ())
950956 h = min (desktoprct .height (),self .settings ['WindowPosition/Height' ].getValue ())
951957 x = max (0 ,min (desktoprct .width () - w ,self .settings ['WindowPosition/X' ].getValue ()))
@@ -1116,7 +1122,7 @@ def load(self,paths):
11161122 # Create a name for the data store based on the file name,
11171123 # but make sure it is unique.
11181124 basestorename ,ext = os .path .splitext (os .path .basename (path ))
1119- basestorename = re .sub ('\W' ,'_' ,basestorename )
1125+ basestorename = re .sub (r '\W' ,'_' ,basestorename )
11201126 if basestorename [0 ].isdigit (): basestorename = '_' + basestorename
11211127 storename ,i = basestorename ,0
11221128 while storename in curstorenames :
0 commit comments