Makefiles are now handled in a separate plug-in
This commit is contained in:
parent
1c86530ce1
commit
97e09a02a7
|
@ -52,7 +52,6 @@ typedef struct _BrowserPlugin
|
|||
GtkWidget * f_revision;
|
||||
/* additional actions */
|
||||
GtkWidget * add;
|
||||
GtkWidget * make;
|
||||
|
||||
/* tasks */
|
||||
CVSTask ** tasks;
|
||||
|
@ -83,7 +82,6 @@ static void _cvs_on_annotate(gpointer data);
|
|||
static void _cvs_on_commit(gpointer data);
|
||||
static void _cvs_on_diff(gpointer data);
|
||||
static void _cvs_on_log(gpointer data);
|
||||
static void _cvs_on_make(gpointer data);
|
||||
static void _cvs_on_update(gpointer data);
|
||||
|
||||
|
||||
|
@ -192,9 +190,6 @@ static CVS * _cvs_init(BrowserPluginHelper * helper)
|
|||
cvs->add = _init_button(bgroup, GTK_STOCK_ADD, _("Add to repository"),
|
||||
G_CALLBACK(_cvs_on_add), cvs);
|
||||
gtk_box_pack_start(GTK_BOX(cvs->widget), cvs->add, FALSE, TRUE, 0);
|
||||
cvs->make = _init_button(bgroup, GTK_STOCK_EXECUTE, _("Run make"),
|
||||
G_CALLBACK(_cvs_on_make), cvs);
|
||||
gtk_box_pack_start(GTK_BOX(cvs->widget), cvs->make, FALSE, TRUE, 0);
|
||||
gtk_widget_show_all(cvs->widget);
|
||||
pango_font_description_free(font);
|
||||
/* tasks */
|
||||
|
@ -271,7 +266,6 @@ static GtkWidget * _cvs_get_widget(CVS * cvs)
|
|||
/* cvs_refresh */
|
||||
static void _refresh_dir(CVS * cvs);
|
||||
static void _refresh_file(CVS * cvs);
|
||||
static void _refresh_make(CVS * cvs, struct stat * st);
|
||||
static void _refresh_status(CVS * cvs, char const * status);
|
||||
|
||||
static void _cvs_refresh(CVS * cvs, GList * selection)
|
||||
|
@ -295,12 +289,10 @@ static void _cvs_refresh(CVS * cvs, GList * selection)
|
|||
gtk_widget_hide(cvs->directory);
|
||||
gtk_widget_hide(cvs->file);
|
||||
gtk_widget_hide(cvs->add);
|
||||
gtk_widget_hide(cvs->make);
|
||||
if(S_ISDIR(st.st_mode))
|
||||
_refresh_dir(cvs);
|
||||
else
|
||||
_refresh_file(cvs);
|
||||
_refresh_make(cvs, &st);
|
||||
}
|
||||
|
||||
static void _refresh_dir(CVS * cvs)
|
||||
|
@ -401,28 +393,6 @@ static void _refresh_file(CVS * cvs)
|
|||
}
|
||||
}
|
||||
|
||||
static void _refresh_make(CVS * cvs, struct stat * st)
|
||||
{
|
||||
gboolean show = FALSE;
|
||||
gchar * dirname;
|
||||
char const * makefile[] = { "Makefile", "makefile", "GNUmakefile" };
|
||||
size_t i;
|
||||
gchar * p;
|
||||
|
||||
dirname = S_ISDIR(st->st_mode) ? g_strdup(cvs->filename)
|
||||
: g_path_get_dirname(cvs->filename);
|
||||
for(i = 0; show == FALSE && i < sizeof(makefile) / sizeof(*makefile);
|
||||
i++)
|
||||
{
|
||||
p = g_strdup_printf("%s/%s", dirname, makefile[i]);
|
||||
show = (lstat(p, st) == 0) ? TRUE : FALSE;
|
||||
g_free(p);
|
||||
}
|
||||
g_free(dirname);
|
||||
if(show)
|
||||
gtk_widget_show(cvs->make);
|
||||
}
|
||||
|
||||
static void _refresh_status(CVS * cvs, char const * status)
|
||||
{
|
||||
if(status == NULL)
|
||||
|
@ -779,23 +749,6 @@ static void _cvs_on_log(gpointer data)
|
|||
}
|
||||
|
||||
|
||||
/* cvs_on_make */
|
||||
static void _cvs_on_make(gpointer data)
|
||||
{
|
||||
CVS * cvs = data;
|
||||
struct stat st;
|
||||
gchar * dirname;
|
||||
char * argv[] = { "make", NULL };
|
||||
|
||||
if(cvs->filename == NULL || lstat(cvs->filename, &st) != 0)
|
||||
return;
|
||||
dirname = S_ISDIR(st.st_mode) ? g_strdup(cvs->filename)
|
||||
: g_path_get_dirname(cvs->filename);
|
||||
_cvs_add_task(cvs, "make", dirname, argv);
|
||||
g_free(dirname);
|
||||
}
|
||||
|
||||
|
||||
/* cvs_on_update */
|
||||
static void _cvs_on_update(gpointer data)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,6 @@ typedef struct _BrowserPlugin
|
|||
GtkWidget * file;
|
||||
/* additional actions */
|
||||
GtkWidget * add;
|
||||
GtkWidget * make;
|
||||
|
||||
/* tasks */
|
||||
GitTask ** tasks;
|
||||
|
@ -77,7 +76,6 @@ static void _git_on_blame(gpointer data);
|
|||
static void _git_on_commit(gpointer data);
|
||||
static void _git_on_diff(gpointer data);
|
||||
static void _git_on_log(gpointer data);
|
||||
static void _git_on_make(gpointer data);
|
||||
static void _git_on_pull(gpointer data);
|
||||
|
||||
|
||||
|
@ -173,9 +171,6 @@ static Git * _git_init(BrowserPluginHelper * helper)
|
|||
git->add = _init_button(bgroup, GTK_STOCK_ADD, _("Add to repository"),
|
||||
G_CALLBACK(_git_on_add), git);
|
||||
gtk_box_pack_start(GTK_BOX(git->widget), git->add, FALSE, TRUE, 0);
|
||||
git->make = _init_button(bgroup, GTK_STOCK_EXECUTE, _("Run make"),
|
||||
G_CALLBACK(_git_on_make), git);
|
||||
gtk_box_pack_start(GTK_BOX(git->widget), git->make, FALSE, TRUE, 0);
|
||||
gtk_widget_show_all(git->widget);
|
||||
pango_font_description_free(font);
|
||||
/* tasks */
|
||||
|
@ -234,7 +229,6 @@ static GtkWidget * _git_get_widget(Git * git)
|
|||
|
||||
/* git_refresh */
|
||||
static void _refresh_dir(Git * git);
|
||||
static void _refresh_make(Git * git, struct stat * st);
|
||||
static void _refresh_status(Git * git, char const * status);
|
||||
|
||||
static void _git_refresh(Git * git, GList * selection)
|
||||
|
@ -258,10 +252,8 @@ static void _git_refresh(Git * git, GList * selection)
|
|||
gtk_widget_hide(git->directory);
|
||||
gtk_widget_hide(git->file);
|
||||
gtk_widget_hide(git->add);
|
||||
gtk_widget_hide(git->make);
|
||||
if(S_ISDIR(st.st_mode))
|
||||
_refresh_dir(git);
|
||||
_refresh_make(git, &st);
|
||||
}
|
||||
|
||||
static void _refresh_dir(Git * git)
|
||||
|
@ -281,28 +273,6 @@ static void _refresh_dir(Git * git)
|
|||
gtk_widget_show(git->directory);
|
||||
}
|
||||
|
||||
static void _refresh_make(Git * git, struct stat * st)
|
||||
{
|
||||
gboolean show = FALSE;
|
||||
gchar * dirname;
|
||||
char const * makefile[] = { "Makefile", "makefile", "GNUmakefile" };
|
||||
size_t i;
|
||||
gchar * p;
|
||||
|
||||
dirname = S_ISDIR(st->st_mode) ? g_strdup(git->filename)
|
||||
: g_path_get_dirname(git->filename);
|
||||
for(i = 0; show == FALSE && i < sizeof(makefile) / sizeof(*makefile);
|
||||
i++)
|
||||
{
|
||||
p = g_strdup_printf("%s/%s", dirname, makefile[i]);
|
||||
show = (lstat(p, st) == 0) ? TRUE : FALSE;
|
||||
g_free(p);
|
||||
}
|
||||
g_free(dirname);
|
||||
if(show)
|
||||
gtk_widget_show(git->make);
|
||||
}
|
||||
|
||||
static void _refresh_status(Git * git, char const * status)
|
||||
{
|
||||
if(status == NULL)
|
||||
|
@ -556,23 +526,6 @@ static void _git_on_log(gpointer data)
|
|||
}
|
||||
|
||||
|
||||
/* git_on_make */
|
||||
static void _git_on_make(gpointer data)
|
||||
{
|
||||
Git * git = data;
|
||||
struct stat st;
|
||||
gchar * dirname;
|
||||
char * argv[] = { "make", NULL };
|
||||
|
||||
if(git->filename == NULL || lstat(git->filename, &st) != 0)
|
||||
return;
|
||||
dirname = S_ISDIR(st.st_mode) ? g_strdup(git->filename)
|
||||
: g_path_get_dirname(git->filename);
|
||||
_git_add_task(git, "make", dirname, argv);
|
||||
g_free(dirname);
|
||||
}
|
||||
|
||||
|
||||
/* git_on_pull */
|
||||
static void _git_on_pull(gpointer data)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,6 @@ typedef struct _BrowserPlugin
|
|||
GtkWidget * file;
|
||||
/* additional actions */
|
||||
GtkWidget * add;
|
||||
GtkWidget * make;
|
||||
|
||||
/* tasks */
|
||||
SVNTask ** tasks;
|
||||
|
@ -73,7 +72,6 @@ static void _subversion_on_blame(gpointer data);
|
|||
static void _subversion_on_commit(gpointer data);
|
||||
static void _subversion_on_diff(gpointer data);
|
||||
static void _subversion_on_log(gpointer data);
|
||||
static void _subversion_on_make(gpointer data);
|
||||
static void _subversion_on_update(gpointer data);
|
||||
|
||||
|
||||
|
@ -169,9 +167,6 @@ static SVN * _subversion_init(BrowserPluginHelper * helper)
|
|||
svn->add = _init_button(bgroup, GTK_STOCK_ADD, _("Add to repository"),
|
||||
G_CALLBACK(_subversion_on_add), svn);
|
||||
gtk_box_pack_start(GTK_BOX(svn->widget), svn->add, FALSE, TRUE, 0);
|
||||
svn->make = _init_button(bgroup, GTK_STOCK_EXECUTE, _("Run make"),
|
||||
G_CALLBACK(_subversion_on_make), svn);
|
||||
gtk_box_pack_start(GTK_BOX(svn->widget), svn->make, FALSE, TRUE, 0);
|
||||
gtk_widget_show_all(svn->widget);
|
||||
pango_font_description_free(font);
|
||||
/* tasks */
|
||||
|
@ -230,7 +225,6 @@ static GtkWidget * _subversion_get_widget(SVN * svn)
|
|||
|
||||
/* subversion_refresh */
|
||||
static void _refresh_dir(SVN * svn);
|
||||
static void _refresh_make(SVN * svn, struct stat * st);
|
||||
static void _refresh_status(SVN * svn, char const * status);
|
||||
|
||||
static void _subversion_refresh(SVN * svn, GList * selection)
|
||||
|
@ -254,10 +248,8 @@ static void _subversion_refresh(SVN * svn, GList * selection)
|
|||
gtk_widget_hide(svn->directory);
|
||||
gtk_widget_hide(svn->file);
|
||||
gtk_widget_hide(svn->add);
|
||||
gtk_widget_hide(svn->make);
|
||||
if(S_ISDIR(st.st_mode))
|
||||
_refresh_dir(svn);
|
||||
_refresh_make(svn, &st);
|
||||
}
|
||||
|
||||
static void _refresh_dir(SVN * svn)
|
||||
|
@ -287,28 +279,6 @@ static void _refresh_dir(SVN * svn)
|
|||
gtk_widget_show(svn->directory);
|
||||
}
|
||||
|
||||
static void _refresh_make(SVN * svn, struct stat * st)
|
||||
{
|
||||
gboolean show = FALSE;
|
||||
gchar * dirname;
|
||||
char const * makefile[] = { "Makefile", "makefile", "GNUmakefile" };
|
||||
size_t i;
|
||||
gchar * p;
|
||||
|
||||
dirname = S_ISDIR(st->st_mode) ? g_strdup(svn->filename)
|
||||
: g_path_get_dirname(svn->filename);
|
||||
for(i = 0; show == FALSE && i < sizeof(makefile) / sizeof(*makefile);
|
||||
i++)
|
||||
{
|
||||
p = g_strdup_printf("%s/%s", dirname, makefile[i]);
|
||||
show = (lstat(p, st) == 0) ? TRUE : FALSE;
|
||||
g_free(p);
|
||||
}
|
||||
g_free(dirname);
|
||||
if(show)
|
||||
gtk_widget_show(svn->make);
|
||||
}
|
||||
|
||||
static void _refresh_status(SVN * svn, char const * status)
|
||||
{
|
||||
if(status == NULL)
|
||||
|
@ -520,23 +490,6 @@ static void _subversion_on_log(gpointer data)
|
|||
}
|
||||
|
||||
|
||||
/* svn_on_make */
|
||||
static void _subversion_on_make(gpointer data)
|
||||
{
|
||||
SVN * svn = data;
|
||||
struct stat st;
|
||||
gchar * dirname;
|
||||
char * argv[] = { "make", NULL };
|
||||
|
||||
if(svn->filename == NULL || lstat(svn->filename, &st) != 0)
|
||||
return;
|
||||
dirname = S_ISDIR(st.st_mode) ? g_strdup(svn->filename)
|
||||
: g_path_get_dirname(svn->filename);
|
||||
_subversion_add_task(svn, "make", dirname, argv);
|
||||
g_free(dirname);
|
||||
}
|
||||
|
||||
|
||||
/* svn_on_update */
|
||||
static void _subversion_on_update(gpointer data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user