18
18
* You should have received a copy of the GNU Lesser General Public
19
19
* License along with this library; see the file COPYING.LIB. If not,
20
* write to the Free Software Foundation, Inc., 59 Temple Place -
21
* Suite 330, Boston, MA 02111-1307, USA.
20
* write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
24
24
#ifdef HAVE_CONFIG_H
435
egg_desktop_file_get_integer (EggDesktopFile *desktop_file,
439
return g_key_file_get_integer (desktop_file->key_file,
440
EGG_DESKTOP_FILE_GROUP, key,
435
445
egg_desktop_file_get_string_list (EggDesktopFile *desktop_file,
1277
g_strfreev ((char **)env->pdata);
1278
g_ptr_array_free (env, FALSE);
1287
g_ptr_array_foreach (env, (GFunc)g_free, NULL);
1288
g_ptr_array_free (env, TRUE);
1280
1290
free_document_list (translated_documents);
1386
1396
free_document_list (documents);
1399
case EGG_DESKTOP_FILE_TYPE_UNRECOGNIZED:
1400
case EGG_DESKTOP_FILE_TYPE_DIRECTORY:
1390
1402
g_set_error (error, EGG_DESKTOP_FILE_ERROR,
1391
1403
EGG_DESKTOP_FILE_ERROR_NOT_LAUNCHABLE,
1408
1420
G_LOCK_DEFINE_STATIC (egg_desktop_file);
1409
1421
static EggDesktopFile *egg_desktop_file;
1412
* egg_set_desktop_file:
1413
* @desktop_file_path: path to the application's desktop file
1415
* Creates an #EggDesktopFile for the application from the data at
1416
* @desktop_file_path. This will also call g_set_application_name()
1417
* with the localized application name from the desktop file, and
1418
* gtk_window_set_default_icon_name() or
1419
* gtk_window_set_default_icon_from_file() with the application's
1420
* icon. Other code may use additional information from the desktop
1423
* Note that for thread safety reasons, this function can only
1427
egg_set_desktop_file (const char *desktop_file_path)
1424
egg_set_desktop_file_internal (const char *desktop_file_path,
1425
gboolean set_defaults)
1429
1427
GError *error = NULL;
1458
* egg_set_desktop_file:
1459
* @desktop_file_path: path to the application's desktop file
1461
* Creates an #EggDesktopFile for the application from the data at
1462
* @desktop_file_path. This will also call g_set_application_name()
1463
* with the localized application name from the desktop file, and
1464
* gtk_window_set_default_icon_name() or
1465
* gtk_window_set_default_icon_from_file() with the application's
1466
* icon. Other code may use additional information from the desktop
1468
* See egg_set_desktop_file_without_defaults() for a variant of this
1469
* function that does not set the application name and default window
1472
* Note that for thread safety reasons, this function can only
1473
* be called once, and is mutually exclusive with calling
1474
* egg_set_desktop_file_without_defaults().
1477
egg_set_desktop_file (const char *desktop_file_path)
1479
egg_set_desktop_file_internal (desktop_file_path, TRUE);
1483
* egg_set_desktop_file_without_defaults:
1484
* @desktop_file_path: path to the application's desktop file
1486
* Creates an #EggDesktopFile for the application from the data at
1487
* @desktop_file_path.
1488
* See egg_set_desktop_file() for a variant of this function that
1489
* sets the application name and default window icon from the information
1490
* in the desktop file.
1492
* Note that for thread safety reasons, this function can only
1493
* be called once, and is mutually exclusive with calling
1494
* egg_set_desktop_file().
1497
egg_set_desktop_file_without_defaults (const char *desktop_file_path)
1499
egg_set_desktop_file_internal (desktop_file_path, FALSE);
1460
1503
* egg_get_desktop_file:
1462
1505
* Gets the application's #EggDesktopFile, as set by