Changeset 2119
- Timestamp:
- 06/02/07 01:49:07 (6 years ago)
- Location:
- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src
- Files:
-
- 3 edited
-
mokodesktop.c (modified) (5 diffs)
-
mokodesktop.h (modified) (1 diff)
-
stylusmenu.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/mokodesktop.c
r1496 r2119 180 180 struct stat stat_info; 181 181 182 char vfolder_path_root[ 512];183 char vfolder_path[ 512];184 char orig_wd[ 256];182 char vfolder_path_root[PATH_MAX]; 183 char vfolder_path[PATH_MAX]; 184 char orig_wd[PATH_MAX]; 185 185 186 186 int desktops_dirs_n = APP_PATHS_N; … … 193 193 MBDotDesktop *dd, *user_overides = NULL; 194 194 195 char app_paths[APP_PATHS_N][ 256];195 char app_paths[APP_PATHS_N][PATH_MAX]; 196 196 struct dirent **namelist; 197 197 /* … … 203 203 ItemTypeDotDesktop = type_reg_cnt; 204 204 205 snprintf( vfolder_path_root, 512, "%s/.matchbox/vfolders/Root.directory",205 snprintf( vfolder_path_root, PATH_MAX, "%s/.matchbox/vfolders/Root.directory", 206 206 mb_util_get_homedir()); 207 snprintf( vfolder_path, 512, "%s/.matchbox/vfolders",207 snprintf( vfolder_path, PATH_MAX, "%s/.matchbox/vfolders", 208 208 mb_util_get_homedir()); 209 209 210 210 if (stat(vfolder_path_root, &stat_info)) 211 211 { 212 snprintf(vfolder_path_root, 512, VFOLDERDIR"/vfolders/Root.directory");213 snprintf(vfolder_path, 512, VFOLDERDIR "/vfolders" );212 snprintf(vfolder_path_root, PATH_MAX, VFOLDERDIR"/vfolders/Root.directory"); 213 snprintf(vfolder_path, PATH_MAX, VFOLDERDIR "/vfolders" ); 214 214 } 215 215 … … 249 249 250 250 251 //snprintf(app_paths[0], 256, "%s/applications", DATADIR);252 snprintf(app_paths[0], 256, "/usr/share/applications");253 snprintf(app_paths[1], 256, "/usr/share/applications");254 snprintf(app_paths[2], 256, "/usr/local/share/applications");255 snprintf(app_paths[3], 256, "%s/.applications", mb_util_get_homedir());256 257 if (getcwd(orig_wd, 255) == (char *)NULL)251 //snprintf(app_paths[0], PATH_MAX-1, "%s/applications", DATADIR); 252 snprintf(app_paths[0], PATH_MAX-1, "/usr/share/applications"); 253 snprintf(app_paths[1], PATH_MAX-1, "/usr/share/applications"); 254 snprintf(app_paths[2], PATH_MAX-1, "/usr/local/share/applications"); 255 snprintf(app_paths[3], PATH_MAX-1, "%s/.applications", mb_util_get_homedir()); 256 257 if (getcwd(orig_wd, PATH_MAX-1) == (char *)NULL) 258 258 { 259 259 fprintf(stderr, "Cant get current directory\n"); … … 301 301 { 302 302 MokoDesktopItem *folder = NULL; 303 char full_path[ 512];303 char full_path[PATH_MAX]; 304 304 char *folder_name = NULL; 305 305 -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/mokodesktop.h
r1768 r2119 9 9 #include <signal.h> 10 10 #include <sys/types.h> 11 #include <sys/param.h> 11 12 #include <sys/stat.h> 12 13 #include <dirent.h> -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-mainmenu/src/stylusmenu.c
r1713 r2119 4 4 * Authored by Sun Zhiyong <sunzhiyong@fic-sh.com.cn> 5 5 * 6 * Copyright (C) 2006 First International ComputerInc.6 * Copyright (C) 2006-2007 OpenMoko, Inc. 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU Public License as published by10 * the Free Software Foundation; version 2. 1of the license.9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; version 2.0 of the license. 11 11 * 12 12 * This program is distributed in the hope that it will be useful, … … 42 42 else 43 43 { 44 char path[ 512];45 snprintf (path, 512, "%s/%s", PIXMAP_PATH, item_new->icon_name);44 char path[PATH_MAX]; 45 snprintf (path, PATH_MAX, "%s/%s", PIXMAP_PATH, item_new->icon_name); 46 46 if (access (path, 0) == 0) 47 47 menu_item = moko_build_new_menu_item (item_new->name, path); 48 48 else 49 49 { 50 snprintf (path, 512, "%s/%s", PKGDATADIR, "default-app-icon.xpm");50 snprintf (path, PATH_MAX, "%s/%s", PKGDATADIR, "default-app-icon.xpm"); 51 51 menu_item = moko_build_new_menu_item (item_new->name, path); 52 52 //moko_fill_model(self->list_store, path, item_new->name, item_new); … … 70 70 else 71 71 { 72 char path[ 512];73 snprintf (path, 512, "%s/%s", PIXMAP_PATH, tmp_item->icon_name);72 char path[PATH_MAX]; 73 snprintf (path, PATH_MAX, "%s/%s", PIXMAP_PATH, tmp_item->icon_name); 74 74 if (access (path, 0) == 0) 75 75 menu_item = moko_build_new_menu_item (tmp_item->name, path); 76 76 else 77 77 { 78 snprintf (path, 512, "%s/%s", PKGDATADIR, "default-app-icon.xpm");78 snprintf (path, PATH_MAX, "%s/%s", PKGDATADIR, "default-app-icon.xpm"); 79 79 menu_item = moko_build_new_menu_item (tmp_item->name, path); 80 80 //moko_fill_model(self->list_store, path, item_new->name, item_new);
Note: See TracChangeset
for help on using the changeset viewer.
