make configuration file management as such
[simple-launcher] / tests / test.cc
1 // This file is a part of Simple Launcher
2 //
3 // Copyright (C) 2006, 2007, Mikhail Sobolev
4 //
5 // Simple Launcher is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License version 2 as published by
7 // the Free Software Foundation.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12 // more details.
13 //
14 // You should have received a copy of the GNU General Public License along with
15 // this program; if not, write to the Free Software Foundation, Inc., 51
16 // Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 #include <iostream>
19
20 #include "launcher-item.h"
21
22 char *files[] = {
23   "/usr/share/applications/hildon/hildon-control-panel.desktop",
24   "/usr/share/applications/hildon/hwr-teacher.desktop",
25   "/usr/share/applications/hildon/osso-backup.desktop",
26   "/usr/share/applications/hildon/osso-global-search.desktop",
27   0
28 };
29
30 int main() {
31   for (int i = 0 ; files[i] != 0 ; ++i) {
32     LauncherItem *item = new LauncherItem();
33
34     if (item->load(files[i])) {
35       std::cout << "Loaded " << files[i] << std::endl
36                 << " name: " << item->getName() << std::endl
37                 << " comment: " << item->getComment() << std::endl
38                 << " service: " << item->getService() << std::endl;
39     } else {
40       std::cout << "Failed to load " << files[i] << std::endl;
41     }
42
43     delete item;
44   }
45
46   return 0;
47 }
48
49 // vim:ts=2:sw=2:et