gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Desktop file generated with wrong path ?


From: Philippe Roussel
Subject: Re: Desktop file generated with wrong path ?
Date: Fri, 11 Mar 2011 11:36:38 +0100

Le jeudi 10 mars 2011 à 17:56 -0500, Gregory Casamento a écrit :
> I will have another look at this tonight to see if I cant fix some of
> these things.  I'd like to make integration with GNOME as smooth and
> seamless as possible.

It's probably the wrong way to do it but with the following patch the
icon path is set correctly and the desktop file recognized as such by
Nautilus.

Hope this helps,
Philippe


Index: base/Tools/pl2link.m
===================================================================
--- base/Tools/pl2link.m        (révision 32530)
+++ base/Tools/pl2link.m        (copie de travail)
@@ -30,6 +30,7 @@
 #import        "Foundation/NSException.h"
 #import        "Foundation/NSFileManager.h"
 #import        "Foundation/NSProcessInfo.h"
+#import        "Foundation/NSPathUtilities.h"
 
 int
 main(int argc, char** argv, char **env)
@@ -46,6 +47,7 @@
   NSString              *installDomain;
   NSString              *installPath = @"";
   NSString              *appName = @"";
+  NSDictionary          *gnustepConfig;
 
 #ifdef GS_PASS_ARGUMENTS
   GSInitializeProcess(argc, argv, env);
@@ -117,27 +119,39 @@
     {
       [fileContents appendFormat: @"address@hidden", entry];
     }
+  gnustepConfig = GNUstepConfig(nil);
   installDomain = [[procinfo environment] objectForKey: 
@"GNUSTEP_INSTALLATION_DOMAIN"];
   if(installDomain != nil)
     {
       if([installDomain isEqualToString: @"SYSTEM"])
        {
-         installPath = [[procinfo environment] objectForKey: 
@"GNUSTEP_SYSTEM_ROOT"];
+         if([gnustepConfig objectForKey:@"GNUSTEP_SYSTEM_APPS"])
+           installPath = [gnustepConfig objectForKey:@"GNUSTEP_SYSTEM_APPS"];
+         else
+           installPath = [[[procinfo environment] objectForKey: 
@"GNUSTEP_SYSTEM_ROOT"] 
+                           stringByAppendingPathComponent:@"Applications"];
        }
       else
        {
-         installPath = [[procinfo environment] objectForKey: 
@"GNUSTEP_LOCAL_ROOT"];
+         if([gnustepConfig objectForKey:@"GNUSTEP_LOCAL_APPS"])
+           installPath = [gnustepConfig objectForKey:@"GNUSTEP_LOCAL_APPS"];
+         else
+           installPath = [[[procinfo environment] objectForKey: 
@"GNUSTEP_LOCAL_ROOT"]
+                           stringByAppendingPathComponent:@"Applications"];
        }
     }
   else
     {
-      installPath = [[procinfo environment] objectForKey: 
@"GNUSTEP_LOCAL_ROOT"];
+      if([gnustepConfig objectForKey:@"GNUSTEP_LOCAL_APPS"])
+       installPath = [gnustepConfig objectForKey:@"GNUSTEP_LOCAL_APPS"];
+      else
+       installPath = [[[procinfo environment] objectForKey: 
@"GNUSTEP_LOCAL_ROOT"]
+                           stringByAppendingPathComponent:@"Applications"];
     }
   entry = [plist objectForKey: @"NSIcon"];
   if (entry != nil)
     {
-      NSString *iconPath = [[[[[installPath stringByAppendingPathComponent: 
@"Applications"] 
-                               stringByAppendingPathComponent:appName] 
+      NSString *iconPath = [[[[installPath 
stringByAppendingPathComponent:appName] 
                               stringByAppendingPathExtension:@"app"] 
                              stringByAppendingPathComponent:@"Resources"]
                             stringByAppendingPathComponent:entry];
Index: make/Instance/application.make
===================================================================
--- make/Instance/application.make      (révision 32530)
+++ make/Instance/application.make      (copie de travail)
@@ -321,7 +321,8 @@
          fi$(END_ECHO)
 
 $(APP_DIR)/Resources/$(GNUSTEP_INSTANCE).desktop: $(APP_INFO_PLIST_FILE)
-       $(ECHO_CREATING)pl2link $^ 
$(APP_DIR)/Resources/$(GNUSTEP_INSTANCE).desktop$(END_ECHO)
+       $(ECHO_CREATING)pl2link $^ 
$(APP_DIR)/Resources/$(GNUSTEP_INSTANCE).desktop; \
+       chmod a+x $(APP_DIR)/Resources/$(GNUSTEP_INSTANCE).desktop$(END_ECHO)
 
 endif
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]