Changeset 194 for trunk/Core.pas
- Timestamp:
- Feb 17, 2025, 11:00:39 PM (5 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r188 r194 7 7 LastOpenedList, ApplicationInfo, PersistentForm, ScaleDPI, Common, 8 8 Translator, DataFile, VCard, Menus, RegistryEx, Theme, FormMain, 9 Registry, VCardFile, FormKeyShortcuts ;9 Registry, VCardFile, FormKeyShortcuts, LazFileUtils; 10 10 11 11 type … … 91 91 procedure FileModified(Sender: TObject); 92 92 function FindFirstNonOption: string; 93 function GetAppShareDir(Dir: string): string; 93 94 procedure LoadConfig; 94 95 procedure SaveConfig; … … 468 469 end; 469 470 471 function TCore.GetAppShareDir(Dir: string): string; 472 {$IFDEF UNIX} 473 var 474 NewDir: string; 475 {$ENDIF} 476 begin 477 Result := ExtractFileDir(Application.ExeName) + DirectorySeparator + Dir; 478 {$IFDEF UNIX} 479 // If installed in Linux system then try to use different installation directory 480 if not DirectoryExists(Result) then begin 481 NewDir := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' + 482 DirectorySeparator + 'share' + DirectorySeparator + 483 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Dir; 484 if DirectoryExists(NewDir) then Result := NewDir; 485 end; 486 {$ENDIF} 487 end; 488 470 489 procedure TCore.DataModuleCreate(Sender: TObject); 471 {$IFDEF UNIX} 472 const 473 LinuxDataFilesDir = '/usr/share/vCardStudio'; 474 LinuxLanguagesDir = LinuxDataFilesDir + '/Languages'; 475 LinuxImagesDir = LinuxDataFilesDir + '/Images'; 476 {$ENDIF} 477 begin 478 ProfilePhotoFileName := ExtractFilePath(ParamStr(0)) + DirectorySeparator + 479 'Images' + DirectorySeparator + 'Profile.png'; 480 {$IFDEF UNIX} 481 // If installed in Linux system then use installation directory for po files 482 if not DirectoryExists(Translator.POFilesFolder) and DirectoryExists(LinuxLanguagesDir) then begin 483 Translator.POFilesFolder := LinuxLanguagesDir; 484 end; 485 // If installed in Linux system then use installation directory for images files 486 if not DirectoryExists('Images') and DirectoryExists(LinuxImagesDir) then begin 487 ProfilePhotoFileName := LinuxImagesDir + DirectorySeparator + 'Profile.png'; 488 end; 489 {$ENDIF} 490 begin 491 ProfilePhotoFileName := GetAppShareDir('Images') + DirectorySeparator + 'Profile.png'; 492 Translator.POFilesFolder := GetAppShareDir('Languages'); 490 493 491 494 DataFile := nil;
Note:
See TracChangeset
for help on using the changeset viewer.