issue 87 : another try
git-svn-id: http://tint2.googlecode.com/svn/trunk@80 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
e43bf23b67
commit
a081c0a57d
2 changed files with 19 additions and 2 deletions
|
@ -140,10 +140,27 @@ void init_battery()
|
|||
}
|
||||
}
|
||||
if (battery_dir != 0) {
|
||||
path_energy_now = g_build_filename(battery_dir, "energy_now", NULL);
|
||||
path_energy_full = g_build_filename(battery_dir, "energy_full", NULL);
|
||||
char *path1 = g_build_filename(battery_dir, "energy_now", NULL);
|
||||
if (g_file_test (path1, G_FILE_TEST_EXISTS)) {
|
||||
path_energy_now = g_build_filename(battery_dir, "energy_now", NULL);
|
||||
path_energy_full = g_build_filename(battery_dir, "energy_full", NULL);
|
||||
}
|
||||
else {
|
||||
char *path2 = g_build_filename(battery_dir, "charge_now", NULL);
|
||||
if (g_file_test (path2, G_FILE_TEST_EXISTS)) {
|
||||
path_energy_now = g_build_filename(battery_dir, "charge_now", NULL);
|
||||
path_energy_full = g_build_filename(battery_dir, "charge_full", NULL);
|
||||
}
|
||||
else {
|
||||
g_free(battery_dir);
|
||||
battery_dir = 0;
|
||||
fprintf(stderr, "ERROR: can't found energy_* or charge_*\n");
|
||||
}
|
||||
g_free(path2);
|
||||
}
|
||||
path_current_now = g_build_filename(battery_dir, "current_now", NULL);
|
||||
path_status = g_build_filename(battery_dir, "status", NULL);
|
||||
g_free(path1);
|
||||
}
|
||||
|
||||
FILE *fp;
|
||||
|
|
BIN
src/tint2
BIN
src/tint2
Binary file not shown.
Loading…
Reference in a new issue