Commit 70eb201c authored by Christian Hergert's avatar Christian Hergert
Browse files

libide: add back support log generation

parent cd0da1c3
......@@ -360,6 +360,8 @@ libide_1_0_la_SOURCES = \
search/ide-omni-search-group.h \
search/ide-omni-search-row.c \
search/ide-omni-search-row.h \
support/ide-support.c \
support/ide-support.h \
theatrics/ide-box-theatric.c \
theatrics/ide-box-theatric.h \
util/ide-cairo.c \
......@@ -410,6 +412,7 @@ libide_1_0_la_includes = \
-I$(srcdir)/modelines \
-I$(srcdir)/preferences \
-I$(srcdir)/resources \
-I$(srcdir)/support \
-I$(srcdir)/theatrics \
-I$(srcdir)/util \
$(NULL)
......
......@@ -28,6 +28,7 @@
#include "ide-application-private.h"
#include "ide-debug.h"
#include "ide-shortcuts-window.h"
#include "ide-support.h"
#include "ide-workbench.h"
static void
......@@ -68,7 +69,6 @@ ide_application_actions_preferences (GSimpleAction *action,
IDE_EXIT;
}
#if 0
static void
ide_application_actions_support (GSimpleAction *action,
GVariant *parameter,
......@@ -119,7 +119,6 @@ cleanup:
g_free (str);
g_free (log_path);
}
#endif
static void
ide_application_actions_quit (GSimpleAction *action,
......@@ -337,7 +336,7 @@ static const GActionEntry IdeApplicationActions[] = {
{ "preferences", ide_application_actions_preferences },
{ "quit", ide_application_actions_quit },
{ "shortcuts", ide_application_actions_shortcuts },
//{ "support", ide_application_actions_support },
{ "support", ide_application_actions_support },
};
void
......
......@@ -48,6 +48,8 @@ struct _IdeApplication
IdeKeybindings *keybindings;
IdeRecentProjects *recent_projects;
GDateTime *started_at;
};
void ide_application_discover_plugins (IdeApplication *self) G_GNUC_INTERNAL;
......
......@@ -352,6 +352,7 @@ ide_application_finalize (GObject *object)
g_clear_pointer (&self->dbus_address, g_free);
g_clear_pointer (&self->tool_arguments, g_strfreev);
g_clear_pointer (&self->started_at, g_date_time_unref);
g_clear_object (&self->worker_manager);
g_clear_object (&self->keybindings);
g_clear_object (&self->recent_projects);
......@@ -378,6 +379,7 @@ ide_application_init (IdeApplication *self)
{
ide_set_program_name (PACKAGE_NAME);
self->started_at = g_date_time_new_now_utc ();
self->mode = IDE_APPLICATION_MODE_PRIMARY;
setlocale (LC_ALL, "");
......@@ -575,3 +577,17 @@ ide_application_get_keybindings_mode (IdeApplication *self)
return NULL;
}
/**
* ide_application_get_started_at:
* @self: A #IdeApplication.
*
* Gets the startup time of the application.
*
* Returns: (transfer none): A #GDateTime.
*/
GDateTime *
ide_application_get_started_at (IdeApplication *self)
{
return self->started_at;
}
......@@ -39,6 +39,7 @@ typedef enum
IdeApplicationMode ide_application_get_mode (IdeApplication *self);
IdeApplication *ide_application_new (void);
GDateTime *ide_application_get_started_at (IdeApplication *self);
IdeRecentProjects *ide_application_get_recent_projects (IdeApplication *self);
void ide_application_show_projects_window (IdeApplication *self);
const gchar *ide_application_get_keybindings_mode (IdeApplication *self);
......
/* gb-support.c
/* ide-support.c
*
* Copyright (C) 2014 Christian Hergert <christian@hergert.me>
*
......@@ -20,8 +20,9 @@
#include <string.h>
#include "egg-counter.h"
#include "gb-application.h"
#include "gb-support.h"
#include "ide-application.h"
#include "ide-support.h"
static gchar *
str_to_key (const gchar *str)
......@@ -43,9 +44,8 @@ counter_arena_foreach_cb (EggCounter *counter,
}
gchar *
gb_get_support_log (void)
ide_get_support_log (void)
{
GApplication *app;
GChecksum *checksum;
GDateTime *now;
GDateTime *started_at;
......@@ -55,8 +55,6 @@ gb_get_support_log (void)
guint i;
guint n_monitors;
app = g_application_get_default ();
str = g_string_new (NULL);
/*
......@@ -77,7 +75,7 @@ gb_get_support_log (void)
g_string_append_printf (str, "current_dir = \"%s\"\n", tmp);
g_free (tmp);
started_at = gb_application_get_started_at (GB_APPLICATION (app));
started_at = ide_application_get_started_at (IDE_APPLICATION_DEFAULT);
tmp = g_date_time_format (started_at, "%FT%H:%M:%SZ");
g_string_append_printf (str, "started-at = \"%s\"\n", tmp);
g_free (tmp);
......
/* gb-support.h
/* ide-support.h
*
* Copyright (C) 2014 Christian Hergert <christian@hergert.me>
*
......@@ -16,15 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GB_SUPPORT_H
#define GB_SUPPORT_H
#ifndef IDE_SUPPORT_H
#define IDE_SUPPORT_H
#include <glib.h>
G_BEGIN_DECLS
gchar *gb_get_support_log (void);
gchar *ide_get_support_log (void);
G_END_DECLS
#endif /* GB_SUPPORT_H */
#endif /* IDE_SUPPORT_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment