Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=136d6b9b925d91b65d16fd4c82fdc15db22e2639

commit 136d6b9b925d91b65d16fd4c82fdc15db22e2639
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Jan 3 13:26:42 2011 +0100

*pacman.vala
return bool when check updated packages

diff --git a/frugal-tweak-vala/src/pacman.vala 
b/frugal-tweak-vala/src/pacman.vala
index 807708e..5c2554d 100644
--- a/frugal-tweak-vala/src/pacman.vala
+++ b/frugal-tweak-vala/src/pacman.vala
@@ -89,19 +89,20 @@ public class pacman

}

-       public void CheckUpdate()
+       public bool CheckUpdate()
{
+               bool pkgUpdated = false;
PM_LIST *i = null;

if (pacman_trans_init(Pacman.OptionTrans.TYPE_SYNC, 0, null, null, null) == -1) 
{
Tools.ConsoleDebug("pacman_trans_init  failed \n");
-                       return ;
+                       return false;
}

if (Pacman.pacman_trans_sysupgrade() == -1)
{
Tools.ConsoleDebug("pacman_trans_sysupgrade failed \n");
-                       return ;
+                       return false;
}
packages = pacman_trans_getinfo (OptionPM.PACKAGES);
if (packages == null)
@@ -112,7 +113,7 @@ public class pacman
{
Tools.ConsoleDebug("Updates are available\n");
//TODO send event
-
+                       pkgUpdated=true;
for (i=pacman_list_first(packages);i!=null;i=pacman_list_next(i)) {
PM_SYNCPKG *spkg = pacman_list_getdata (i);
PM_PKG *pkg = pacman_sync_getinfo (spkg, OptionPMSYNC.PKG);
@@ -121,5 +122,6 @@ public class pacman

}
pacman_trans_release ();
+               return pkgUpdated;
}
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to