Skip to content

Commit

Permalink
Remove dependency on libgee.
Browse files Browse the repository at this point in the history
  • Loading branch information
PCMan authored and gilir committed Mar 26, 2014
1 parent 9b97e18 commit 8179acd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 43 deletions.
4 changes: 0 additions & 4 deletions configure.ac
Expand Up @@ -72,10 +72,6 @@ PKG_CHECK_MODULES(GIO, [gio-unix-2.0])
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

PKG_CHECK_MODULES(GEE, [gee-0.8])
AC_SUBST(GEE_CFLAGS)
AC_SUBST(GEE_LIBS)

PKG_CHECK_MODULES(DBUSGLIB, [dbus-glib-1])
AC_SUBST(DBUSGLIB_CFLAGS)
AC_SUBST(DBUSGLIB_LIBS)
Expand Down
1 change: 0 additions & 1 deletion lxsession-db/Makefile.am
Expand Up @@ -8,7 +8,6 @@ lxsession_db_SOURCES = \
lxsession_db_VALAFLAGS = \
--vapidir=$(srcdir)/../vapi \
--pkg gtk+-2.0 \
--pkg gee-0.8 \
$(NULL)

lxsession_db_CFLAGS = \
Expand Down
20 changes: 9 additions & 11 deletions lxsession-db/desktop-files-backend.vala
Expand Up @@ -15,8 +15,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

using Gee;

namespace Lxsession
{
[DBus(name = "org.lxde.SessionManager")]
Expand All @@ -36,12 +34,12 @@ namespace Lxsession

public class DBDefaultApps: GLib.Object
{
public ArrayList<string> webbrowser_installed = new ArrayList<string> ();
public ArrayList<string> webbrowser_available = new ArrayList<string> ();
public List<string> webbrowser_installed = new List<string> ();
public List<string> webbrowser_available = new List<string> ();
public string webbrowser_installed_blacklist;

public ArrayList<string> email_installed = new ArrayList<string> ();
public ArrayList<string> email_available = new ArrayList<string> ();
public List<string> email_installed = new List<string> ();
public List<string> email_available = new List<string> ();
public string email_installed_blacklist;

public signal void finish_scanning_installed();
Expand Down Expand Up @@ -245,7 +243,7 @@ namespace Lxsession

/* TODO Make a genereic find_ function ? */

private void find_webbrowser_list(KeyFile kf, string desktop_path, string name, ArrayList<string> list)
private void find_webbrowser_list(KeyFile kf, string desktop_path, string name, List<string> list)
{
try
{
Expand All @@ -260,7 +258,7 @@ namespace Lxsession
{
if ("WebBrowser" in categories)
{
list.add (name);
list.append (name);
}
}
}
Expand All @@ -271,7 +269,7 @@ namespace Lxsession
}
}

private void find_email_list(KeyFile kf, string desktop_path, string name, ArrayList<string> list)
private void find_email_list(KeyFile kf, string desktop_path, string name, List<string> list)
{
try
{
Expand All @@ -286,7 +284,7 @@ namespace Lxsession
{
if ("Email" in categories)
{
list.add (name);
list.append (name);
}
}
}
Expand All @@ -297,7 +295,7 @@ namespace Lxsession
}
}

public string[] string_array_list_to_array (ArrayList<string> list)
public string[] string_array_list_to_array (List<string> list)
{
string tmp_string = null;
string[] array_save;
Expand Down
2 changes: 0 additions & 2 deletions lxsession/Makefile.am
Expand Up @@ -28,7 +28,6 @@ buildinpolkit_SOURCES = \

buildinpolkit_VALAFLAGS = \
--pkg lxpolkit \
--pkg gtk+-2.0 \
-D BUILDIN_POLKIT \
$(NULL)

Expand Down Expand Up @@ -70,7 +69,6 @@ lxsession_VALAFLAGS = \
--vapidir=$(srcdir)/../vapi \
--pkg dbus-glib-1 \
--pkg gio-2.0 \
--pkg gee-0.8 \
--pkg posix \
--pkg lxsettings-daemon \
--pkg xdg-autostart \
Expand Down
32 changes: 16 additions & 16 deletions lxsession/app.vala
Expand Up @@ -21,7 +21,6 @@
TODO packagekit handler (GUI and stuff) ?
TODO Use wnck for managing launching applications ?
*/
using Gee;
using Posix;

namespace Lxsession
Expand Down Expand Up @@ -295,28 +294,29 @@ public class WindowsManagerApp: SimpleAppObject
private string find_window_manager()
{

var wm_list = new ArrayList<string> ();
var wm_list = new Array<string> ();

wm_list.add("openbox-lxde");
wm_list.add("openbox-lubuntu");
wm_list.add("openbox");
wm_list.add("compiz");
wm_list.add("kwin");
wm_list.add("mutter");
wm_list.add("fluxbox");
wm_list.add("metacity");
wm_list.add("xfwin");
wm_list.add("matchbox");
wm_list.append_val("openbox-lxde");
wm_list.append_val("openbox-lubuntu");
wm_list.append_val("openbox");
wm_list.append_val("compiz");
wm_list.append_val("kwin");
wm_list.append_val("mutter");
wm_list.append_val("fluxbox");
wm_list.append_val("metacity");
wm_list.append_val("xfwin");
wm_list.append_val("matchbox");

string return_value = "";

foreach (string i in wm_list)
for(int i = 0; i < wm_list.length; ++i)
{
string test_wm = Environment.find_program_in_path(i);
unowned string wm = wm_list.index(i);
string test_wm = Environment.find_program_in_path(wm);
if ( test_wm != null)
{
message ("Finding %s",i);
return_value = i;
message ("Finding %s",wm);
return_value = wm;
break;
}
}
Expand Down
17 changes: 8 additions & 9 deletions lxsession/autostart.vala
Expand Up @@ -17,17 +17,15 @@
* MA 02110-1301, USA.
*/

using Gee;

namespace Lxsession {

public class LxsessionAutostartConfig: GLib.Object {

private ArrayList<AppType?> stock_list ;
private Array<AppType?> stock_list ;

public LxsessionAutostartConfig() {

/* Copy the ArrayList, can't be modify inside constructor */
/* Copy the Array, can't be modify inside constructor */
stock_list = load_autostart_file();
/*
foreach (AppType s in stock_list) {
Expand All @@ -36,10 +34,10 @@ public class LxsessionAutostartConfig: GLib.Object {
*/
}

public ArrayList<AppType?> load_autostart_file() {
public Array<AppType?> load_autostart_file() {

var file = File.new_for_path (get_config_path ("autostart"));
var app_list = new ArrayList<AppType?> ();
var app_list = new Array<AppType?> ();

message ("Autostart path : %s", file.get_path());

Expand All @@ -61,15 +59,15 @@ public class LxsessionAutostartConfig: GLib.Object {
builder.erase(0,1);
string[] command = builder.str.split_set(" ",0);
AppType app = { command[0], command, true, "" };
app_list.add (app);
app_list.append_val (app);
break;
case ("#"):
/* Commented, skip */
break;
default:
string[] command = line.split_set(" ",0);
AppType app = { command[0], command, false, "" };
app_list.add (app);
app_list.append_val (app);
break;
}
}
Expand All @@ -85,7 +83,8 @@ public class LxsessionAutostartConfig: GLib.Object {

public void start_applications() {

foreach (AppType s in stock_list) {
for (int i = 0; i < stock_list.length; ++i) {
unowned AppType s = stock_list.index(i);
var launch_app = new GenericAppObject(s);
launch_app.launch();
}
Expand Down

0 comments on commit 8179acd

Please sign in to comment.