eric6/UI/BrowserModel.py

changeset 8270
6ba3564b7161
parent 8260
2161475d9639
child 8273
698ae46f40a4
child 8282
16b243bdb12f
equal deleted inserted replaced
8269:87f521f359d5 8270:6ba3564b7161
1153 self._dirName = os.path.dirname(finfo) 1153 self._dirName = os.path.dirname(finfo)
1154 self.sourceLanguage = sourceLanguage 1154 self.sourceLanguage = sourceLanguage
1155 1155
1156 self._moduleName = '' 1156 self._moduleName = ''
1157 1157
1158 # TODO: add icon for eric graphics file
1158 pixName = "" 1159 pixName = ""
1159 if self.isPython3File(): 1160 if self.isPython3File():
1160 pixName = "filePython" 1161 pixName = "filePython"
1161 self._populated = False 1162 self._populated = False
1162 self._lazyPopulation = True 1163 self._lazyPopulation = True
1298 1299
1299 def isRubyFile(self): 1300 def isRubyFile(self):
1300 """ 1301 """
1301 Public method to check, if this file is a Ruby script. 1302 Public method to check, if this file is a Ruby script.
1302 1303
1303 @return flag indicating a Ruby file (boolean) 1304 @return flag indicating a Ruby file
1305 @rtype bool
1304 """ 1306 """
1305 return ( 1307 return (
1306 self.fileext == '.rb' or 1308 self.fileext == '.rb' or
1307 (self.fileext == "" and self.sourceLanguage == "Ruby") 1309 (self.fileext == "" and self.sourceLanguage == "Ruby")
1308 ) 1310 )
1309 1311
1310 def isDesignerFile(self): 1312 def isDesignerFile(self):
1311 """ 1313 """
1312 Public method to check, if this file is a Qt-Designer file. 1314 Public method to check, if this file is a Qt-Designer file.
1313 1315
1314 @return flag indicating a Qt-Designer file (boolean) 1316 @return flag indicating a Qt-Designer file
1317 @rtype bool
1315 """ 1318 """
1316 return self.fileext == '.ui' 1319 return self.fileext == '.ui'
1317 1320
1318 def isLinguistFile(self): 1321 def isLinguistFile(self):
1319 """ 1322 """
1320 Public method to check, if this file is a Qt-Linguist file. 1323 Public method to check, if this file is a Qt-Linguist file.
1321 1324
1322 @return flag indicating a Qt-Linguist file (boolean) 1325 @return flag indicating a Qt-Linguist file
1326 @rtype bool
1323 """ 1327 """
1324 return self.fileext in ['.ts', '.qm'] 1328 return self.fileext in ['.ts', '.qm']
1325 1329
1326 def isResourcesFile(self): 1330 def isResourcesFile(self):
1327 """ 1331 """
1328 Public method to check, if this file is a Qt-Resources file. 1332 Public method to check, if this file is a Qt-Resources file.
1329 1333
1330 @return flag indicating a Qt-Resources file (boolean) 1334 @return flag indicating a Qt-Resources file
1335 @rtype bool
1331 """ 1336 """
1332 return self.fileext == '.qrc' 1337 return self.fileext == '.qrc'
1333 1338
1334 def isProjectFile(self): 1339 def isProjectFile(self):
1335 """ 1340 """
1336 Public method to check, if this file is an eric project file. 1341 Public method to check, if this file is an eric project file.
1337 1342
1338 @return flag indicating an eric project file (boolean) 1343 @return flag indicating an eric project file
1344 @rtype bool
1339 """ 1345 """
1340 return self.fileext in ('.epj', '.e4p') 1346 return self.fileext in ('.epj', '.e4p')
1341 1347
1342 def isMultiProjectFile(self): 1348 def isMultiProjectFile(self):
1343 """ 1349 """
1344 Public method to check, if this file is an eric multi project file. 1350 Public method to check, if this file is an eric multi project file.
1345 1351
1346 @return flag indicating an eric project file (boolean) 1352 @return flag indicating an eric project file
1353 @rtype bool
1347 """ 1354 """
1348 return self.fileext in ('.emj', '.e4m', '.e5m') 1355 return self.fileext in ('.emj', '.e4m', '.e5m')
1349 1356
1350 def isIdlFile(self): 1357 def isIdlFile(self):
1351 """ 1358 """
1352 Public method to check, if this file is a CORBA IDL file. 1359 Public method to check, if this file is a CORBA IDL file.
1353 1360
1354 @return flag indicating a CORBA IDL file (boolean) 1361 @return flag indicating a CORBA IDL file
1362 @rtype bool
1355 """ 1363 """
1356 return self.fileext == '.idl' 1364 return self.fileext == '.idl'
1357 1365
1358 def isProtobufFile(self): 1366 def isProtobufFile(self):
1359 """ 1367 """
1366 1374
1367 def isJavaScriptFile(self): 1375 def isJavaScriptFile(self):
1368 """ 1376 """
1369 Public method to check, if this file is a JavaScript file. 1377 Public method to check, if this file is a JavaScript file.
1370 1378
1371 @return flag indicating a JavaScript file (boolean) 1379 @return flag indicating a JavaScript file
1380 @rtype bool
1372 """ 1381 """
1373 return self.fileext == '.js' 1382 return self.fileext == '.js'
1374 1383
1375 def isPixmapFile(self): 1384 def isPixmapFile(self):
1376 """ 1385 """
1377 Public method to check, if this file is a pixmap file. 1386 Public method to check, if this file is a pixmap file.
1378 1387
1379 @return flag indicating a pixmap file (boolean) 1388 @return flag indicating a pixmap file
1389 @rtype bool
1380 """ 1390 """
1381 return self.fileext[1:] in QImageReader.supportedImageFormats() 1391 return self.fileext[1:] in QImageReader.supportedImageFormats()
1382 1392
1383 def isSvgFile(self): 1393 def isSvgFile(self):
1384 """ 1394 """
1385 Public method to check, if this file is a SVG file. 1395 Public method to check, if this file is a SVG file.
1386 1396
1387 @return flag indicating a SVG file (boolean) 1397 @return flag indicating a SVG file
1398 @rtype bool
1388 """ 1399 """
1389 return self.fileext == '.svg' 1400 return self.fileext == '.svg'
1390 1401
1391 def isDFile(self): 1402 def isDFile(self):
1392 """ 1403 """
1396 """ 1407 """
1397 return ( 1408 return (
1398 self.fileext in ['.d', '.di'] or 1409 self.fileext in ['.d', '.di'] or
1399 (self.fileext == "" and self.sourceLanguage == "D") 1410 (self.fileext == "" and self.sourceLanguage == "D")
1400 ) 1411 )
1412
1413 def isEricGraphicsFile(self):
1414 """
1415 Public method to check, if this is an eric graphics file.
1416
1417 @return flag indicating an eric graphics file
1418 @rtype bool
1419 """
1420 return self.fileext in ('.egj', '.e5g')
1401 1421
1402 def lessThan(self, other, column, order): 1422 def lessThan(self, other, column, order):
1403 """ 1423 """
1404 Public method to check, if the item is less than the other one. 1424 Public method to check, if the item is less than the other one.
1405 1425

eric ide

mercurial