Commit e94a2170 authored by Christian Hergert's avatar Christian Hergert

autotools: remove application addin

This isn't necessary anymore since we use the builddir to store the
Makecache file.
parent 14380d03
......@@ -19,7 +19,6 @@
#include <libpeas/peas.h>
#include <ide.h>
#include "ide-autotools-application-addin.h"
#include "ide-autotools-build-system.h"
#include "ide-autotools-build-target-provider.h"
#include "ide-autotools-pipeline-addin.h"
......@@ -27,7 +26,6 @@
void
ide_autotools_register_types (PeasObjectModule *module)
{
peas_object_module_register_extension_type (module, IDE_TYPE_APPLICATION_ADDIN, IDE_TYPE_AUTOTOOLS_APPLICATION_ADDIN);
peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_PIPELINE_ADDIN, IDE_TYPE_AUTOTOOLS_PIPELINE_ADDIN);
peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_SYSTEM, IDE_TYPE_AUTOTOOLS_BUILD_SYSTEM);
peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_TARGET_PROVIDER, IDE_TYPE_AUTOTOOLS_BUILD_TARGET_PROVIDER);
......
/* ide-autotools-application-addin.c
*
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define G_LOG_DOMAIN "ide-autotools-application-addin"
#include <dazzle.h>
#include <string.h>
#include "ide-autotools-application-addin.h"
struct _IdeAutotoolsApplicationAddin
{
GObject parent_instance;
};
static void
ide_autotools_application_addin_load (IdeApplicationAddin *addin,
IdeApplication *application)
{
g_autofree gchar *path = NULL;
g_autoptr(GFile) file = NULL;
g_autoptr(GFileEnumerator) enumerator = NULL;
gpointer infoptr;
GTimeVal now;
g_assert (IDE_IS_AUTOTOOLS_APPLICATION_ADDIN (addin));
g_assert (IDE_IS_APPLICATION (application));
/*
* TODO: Move this to an IdeDirectoryReaper
*/
path = g_build_filename (g_get_user_cache_dir (),
"gnome-builder",
"makecache",
NULL);
file = g_file_new_for_path (path);
enumerator = g_file_enumerate_children (file,
G_FILE_ATTRIBUTE_STANDARD_NAME,
G_FILE_QUERY_INFO_NONE,
NULL,
NULL);
if (enumerator == NULL)
return;
g_get_current_time (&now);
while (NULL != (infoptr = g_file_enumerator_next_file (enumerator, NULL, NULL)))
{
g_autoptr(GFileInfo) info = infoptr;
const gchar *name = g_file_info_get_name (info);
const gchar *suffix = strrchr (name, '.');
if (suffix && g_str_has_prefix (suffix, ".tmp-"))
{
gint64 time_at;
suffix += DZL_LITERAL_LENGTH (".tmp-");
time_at = g_ascii_strtoll (suffix, NULL, 10);
if (time_at == G_MININT64 || time_at == G_MAXINT64)
continue;
if (time_at + 60 < now.tv_sec)
{
g_autoptr(GFile) child = NULL;
child = g_file_get_child (file, name);
g_file_delete (child, NULL, NULL);
}
}
}
}
static void
application_addin_iface_init (IdeApplicationAddinInterface *iface)
{
iface->load = ide_autotools_application_addin_load;
}
G_DEFINE_TYPE_EXTENDED (IdeAutotoolsApplicationAddin,
ide_autotools_application_addin,
G_TYPE_OBJECT,
0,
G_IMPLEMENT_INTERFACE (IDE_TYPE_APPLICATION_ADDIN,
application_addin_iface_init))
static void
ide_autotools_application_addin_class_init (IdeAutotoolsApplicationAddinClass *klass)
{
}
static void
ide_autotools_application_addin_init (IdeAutotoolsApplicationAddin *self)
{
}
/* ide-autotools-application-addin.h
*
* Copyright © 2016 Christian Hergert <chergert@redhat.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <ide.h>
G_BEGIN_DECLS
#define IDE_TYPE_AUTOTOOLS_APPLICATION_ADDIN (ide_autotools_application_addin_get_type())
G_DECLARE_FINAL_TYPE (IdeAutotoolsApplicationAddin, ide_autotools_application_addin, IDE, AUTOTOOLS_APPLICATION_ADDIN, GObject)
G_END_DECLS
......@@ -8,8 +8,6 @@ autotools_resources = gnome.compile_resources(
autotools_sources = [
'autotools-plugin.c',
'ide-autotools-application-addin.c',
'ide-autotools-application-addin.h',
'ide-autotools-autogen-stage.c',
'ide-autotools-autogen-stage.h',
'ide-autotools-build-system.c',
......
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