Skip to content

Instantly share code, notes, and snippets.

@lpenguin
Created October 24, 2014 15:53
Show Gist options
  • Save lpenguin/2d39eaa2006319f555dd to your computer and use it in GitHub Desktop.
Save lpenguin/2d39eaa2006319f555dd to your computer and use it in GitHub Desktop.
//#include <QCoreApplication>
#include <unity/unity/unity.h>
#include <iostream>
#include <glib/gutils.h>
#include <glib/gmain.h>
using namespace std;
int main(int argc, char *argv[])
{
// UnityAppInfoManager* manager = unity_app_info_manager_get_default();
// UnityLauncherFavorites* favs = unity_launcher_favorites_get_default();
// cout<<"Got favs manager: "<<favs<<endl;
// int len = 0;
// gchar** res = unity_launcher_favorites_enumerate_ids(favs, &len);
// for(int i = 0; i< len; i++){
// cout<<i<<": "<<res[i]<<endl;
// }
//// GAppInfo** appInfos = unity_launcher_favorites_enumerate_app_infos(favs, &len);
//// for(i = 0; i < len; i++){
//// cout<<i<<": "<<appInfo<<endl;
//// }
// int num;
// cout<<"ID# ";
// cin>>num;
UnityLauncherEntry* entry = unity_launcher_entry_get_for_desktop_id("telegram.desktop");
unity_launcher_entry_set_count_visible(entry, 1);
unity_launcher_entry_set_count(entry, 100);
unity_launcher_entry_set_progress(entry, 0.5f);
unity_launcher_entry_set_progress_visible(entry, 1);
//GMainLoop* loop = g_main_loop_new(NULL, false);
g_main_context_iteration(NULL, true);
sleep(10);
// g_main_loop_run(loop);
// QCoreApplication a(argc, argv);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment