Hello community,
here is the log from the commit of package sobby
checked in at Sat Sep 13 12:15:27 CEST 2008.
--------
--- GNOME/sobby/sobby.changes 2008-05-16 05:51:42.000000000 +0200
+++ /mounts/work_src_done/STABLE/sobby/sobby.changes 2008-09-12 16:14:20.000000000 +0200
@@ -1,0 +2,10 @@
+Fri Sep 12 09:13:09 CDT 2008 - maw@suse.de
+
+- Update to version 0.4.5:
+ + Run autosave on SIGUSR1 and SIGTERM if an autosave file is
+ specified, even if autosave interval is 0
+ + Only autosave if the session changed
+ + Added a post-save-hook which could be used to tie the autosave
+ to a VCS commit.
+
+-------------------------------------------------------------------
Old:
----
sobby-0.4.4.tar.bz2
New:
----
sobby-0.4.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sobby.spec ++++++
--- /var/tmp/diff_new_pack.E23072/_old 2008-09-13 12:14:56.000000000 +0200
+++ /var/tmp/diff_new_pack.E23072/_new 2008-09-13 12:14:56.000000000 +0200
@@ -1,10 +1,17 @@
#
-# spec file for package sobby (Version 0.4.4)
+# spec file for package sobby (Version 0.4.5)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@@ -12,12 +19,18 @@
Name: sobby
-BuildRequires: gcc-c++ glibmm2-devel gmp-devel libavahi-glib-devel libxml++-devel obby-devel pkg-config
+BuildRequires: gcc-c++
+BuildRequires: glibmm2-devel
+BuildRequires: gmp-devel
+BuildRequires: libavahi-glib-devel
+BuildRequires: libxml++-devel
+BuildRequires: obby-devel
+BuildRequires: pkg-config
License: GPL v2 or later
Group: System/GUI/GNOME
AutoReqProv: on
-Version: 0.4.4
-Release: 18
+Version: 0.4.5
+Release: 1
Summary: Stand-alone obby server
Source: %{name}-%{version}.tar.bz2
Url: http://gobby.0x539.de/
@@ -56,6 +69,13 @@
%doc %{_mandir}/man1/sobby.*
%changelog
+* Fri Sep 12 2008 maw@suse.de
+- Update to version 0.4.5:
+ + Run autosave on SIGUSR1 and SIGTERM if an autosave file is
+ specified, even if autosave interval is 0
+ + Only autosave if the session changed
+ + Added a post-save-hook which could be used to tie the autosave
+ to a VCS commit.
* Fri May 16 2008 crrodriguez@suse.de
- cleanup build requires
* Thu Apr 03 2008 hpj@suse.de
@@ -68,19 +88,19 @@
* Enabled keepalive to detect stale connections.
* Tue Jan 30 2007 sbrabec@suse.cz
- Spec file cleanup.
-* Mon Jan 29 2007 ro@suse.de
+* Sun Jan 28 2007 ro@suse.de
- move to /usr
* Tue Dec 05 2006 james@usr-local-bin.org
- change glibmm24-devel to glibmm2-devel in BuildRequires
-* Fri Sep 29 2006 ro@suse.de
+* Thu Sep 28 2006 ro@suse.de
- added libxml++-devel to BuildRequires
* Tue Sep 26 2006 wstephenson@suse.de
- Update to version 0.4.1
* Support XML configuration files
* Supports Gobby's command subsystem
-* Sat Sep 16 2006 jhargadon@suse.de
+* Fri Sep 15 2006 jhargadon@suse.de
- applied another compiler warning patch to address bug #202248
-* Sat Sep 02 2006 jhargadon@suse.de
+* Fri Sep 01 2006 jhargadon@suse.de
- patch to eliminate compiler warning #187244
* Sat Feb 25 2006 aj@suse.de
- Reduce BuildRequires.
@@ -90,5 +110,5 @@
- Update to version 0.3.0 [#144674]
* Sat Jan 14 2006 kukuk@suse.de
- Add gmp-devel to nfb
-* Sat Nov 05 2005 gekker@suse.de
+* Fri Nov 04 2005 gekker@suse.de
- Initial import into autobuild, version 0.2.0
++++++ sobby-0.4.4.tar.bz2 -> sobby-0.4.5.tar.bz2 ++++++
++++ 1823 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/ChangeLog new/sobby-0.4.5/ChangeLog
--- old/sobby-0.4.4/ChangeLog 2007-08-19 14:31:31.000000000 +0200
+++ new/sobby-0.4.5/ChangeLog 2008-09-11 15:17:40.000000000 +0200
@@ -1,3 +1,49 @@
+2008-09-11 Philipp Kern
+
+ * configure.ac:
+ * NEWS: bump version to 0.4.5 and document the changes
+
+2008-09-08 Armin Burgmeier
+
+ * inc/server.hpp:
+ * src/server.cpp: Added quit method.
+
+ * src/main.cpp: Run all autosavers on SIGTERM, and exit properly.
+
+2008-07-24 Armin Burgmeier
+
+ * inc/autosaver.hpp:
+ * src/autosaver.cpp: Added a post_save_hook property that specifies a
+ command that is executed everytime the session has been saved to disk.
+
+ * src/server.cpp: Added post-save-hook command line and configuration
+ option.
+
+2008-07-24 Armin Burgmeier
+
+ * inc/autosaver.hpp:
+ * src/autosaver.cpp: Only save if the session has been changed since
+ it has been saved the last time.
+
+2008-03-16 Armin Burgmeier
+
+ * inc/autosaver.hpp:
+ * inc/autosave_folder.hpp:
+ * src/autosaver.cpp:
+ * src/autosave_folder.cpp: Added public save() function, don't set
+ timeout when interval is 0.
+
+ * inc/server.hpp:
+ * src/server.cpp: Added public save() function, also create autosavers
+ when autosave interval is 0.
+
+ * main.cpp: Run both autosavers on SIGUSR1, fixing #345.
+
+2007-09-20 Philipp Kern
+
+ * src/command_executer.cpp: added unistd.h to the list of includes
+ to ease porting to OpenBSD
+
2007-08-18 Philipp Kern
* NEWS:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/configure.ac new/sobby-0.4.5/configure.ac
--- old/sobby-0.4.4/configure.ac 2007-08-19 14:31:31.000000000 +0200
+++ new/sobby-0.4.5/configure.ac 2008-09-11 15:14:03.000000000 +0200
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([sobby], [0.4.4], [crew@0x539.de])
+AC_INIT([sobby], [0.4.5], [crew@0x539.de])
AM_INIT_AUTOMAKE(1.9 check-news)
AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([inc/server.hpp])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/inc/autosave_folder.hpp new/sobby-0.4.5/inc/autosave_folder.hpp
--- old/sobby-0.4.4/inc/autosave_folder.hpp 2007-04-14 21:45:53.000000000 +0200
+++ new/sobby-0.4.5/inc/autosave_folder.hpp 2008-09-11 15:12:43.000000000 +0200
@@ -44,6 +44,8 @@
~AutoSaveFolder();
signal_error_type error_event() const;
+
+ void save();
protected:
typedef std::map map_type;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/inc/autosaver.hpp new/sobby-0.4.5/inc/autosaver.hpp
--- old/sobby-0.4.4/inc/autosaver.hpp 2007-04-14 21:45:53.000000000 +0200
+++ new/sobby-0.4.5/inc/autosaver.hpp 2008-09-11 15:12:43.000000000 +0200
@@ -39,17 +39,27 @@
AutoSaver(const ServerBuffer& buffer,
const std::string& filename,
- unsigned int interval);
+ unsigned int interval,
+ const std::string& post_save_hook);
~AutoSaver();
signal_error_type error_event() const;
+
+ void save();
protected:
bool on_timer();
+ void on_document_insert(DocumentInfo& info);
+ void on_document_remove(DocumentInfo& info);
+ void on_document_change();
+
const ServerBuffer& m_buffer;
std::string m_filename;
+ std::string m_post_save_hook;
sigc::connection m_conn_timer;
signal_error_type m_signal_error;
+
+ bool m_has_modification;
};
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/inc/server.hpp new/sobby-0.4.5/inc/server.hpp
--- old/sobby-0.4.4/inc/server.hpp 2007-04-15 12:54:13.000000000 +0200
+++ new/sobby-0.4.5/inc/server.hpp 2008-09-11 15:12:43.000000000 +0200
@@ -57,6 +57,8 @@
~Server();
void run();
+ void quit();
+ void save();
bool on_cmd_exit(const ArgList& args);
bool on_cmd_help(const ArgList& args);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/INSTALL new/sobby-0.4.5/INSTALL
--- old/sobby-0.4.4/INSTALL 2007-03-30 17:33:48.000000000 +0200
+++ new/sobby-0.4.5/INSTALL 2008-02-10 03:55:24.000000000 +0100
@@ -2,7 +2,7 @@
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -67,6 +67,9 @@
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
Compilers and Options
=====================
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/NEWS new/sobby-0.4.5/NEWS
--- old/sobby-0.4.4/NEWS 2007-08-19 14:31:31.000000000 +0200
+++ new/sobby-0.4.5/NEWS 2008-09-11 15:18:31.000000000 +0200
@@ -1,6 +1,14 @@
sobby
=====
+Version 0.4.5:
+ * Run autosave on SIGUSR1 and SIGTERM if an autosave file is specified,
+ even if autosave interval is 0.
+ * Only autosave if the session changed.
+ * Added a post-save-hook which could be used to tie the autosave to
+ a VCS commit.
+ * Ease porting to OpenBSD.
+
Version 0.4.4:
* Allow initial session file to be specified in the configuration file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/src/autosave_folder.cpp new/sobby-0.4.5/src/autosave_folder.cpp
--- old/sobby-0.4.4/src/autosave_folder.cpp 2007-04-14 21:45:53.000000000 +0200
+++ new/sobby-0.4.5/src/autosave_folder.cpp 2008-09-11 15:12:43.000000000 +0200
@@ -32,10 +32,13 @@
unsigned int interval):
m_buffer(buffer), m_folder(folder)
{
- m_conn_timer = Glib::signal_timeout().connect(
- sigc::mem_fun(*this, &AutoSaveFolder::on_timer),
- interval * 1000
- );
+ if(interval > 0)
+ {
+ m_conn_timer = Glib::signal_timeout().connect(
+ sigc::mem_fun(*this, &AutoSaveFolder::on_timer),
+ interval * 1000
+ );
+ }
buffer.document_insert_event().connect(
sigc::mem_fun(*this, &AutoSaveFolder::on_document_insert));
@@ -77,7 +80,7 @@
return m_signal_error;
}
-bool Sobby::AutoSaveFolder::on_timer()
+void Sobby::AutoSaveFolder::save()
{
try
{
@@ -112,5 +115,10 @@
m_signal_error.emit(e);
}
+}
+
+bool Sobby::AutoSaveFolder::on_timer()
+{
+ save();
return true;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/src/autosaver.cpp new/sobby-0.4.5/src/autosaver.cpp
--- old/sobby-0.4.4/src/autosaver.cpp 2007-04-14 21:45:53.000000000 +0200
+++ new/sobby-0.4.5/src/autosaver.cpp 2008-09-11 15:12:43.000000000 +0200
@@ -24,17 +24,34 @@
#include <stdexcept>
#include
#include
+#include
#include "autosaver.hpp"
Sobby::AutoSaver::AutoSaver(const ServerBuffer& buffer,
const std::string& filename,
- unsigned int interval):
- m_buffer(buffer), m_filename(filename)
+ unsigned int interval,
+ const std::string& post_save_hook):
+ m_buffer(buffer), m_filename(filename),
+ m_post_save_hook(post_save_hook), m_has_modification(true)
{
- m_conn_timer = Glib::signal_timeout().connect(
- sigc::mem_fun(*this, &AutoSaver::on_timer),
- interval * 1000
- );
+ if(interval > 0)
+ {
+ m_conn_timer = Glib::signal_timeout().connect(
+ sigc::mem_fun(*this, &AutoSaver::on_timer),
+ interval * 1000
+ );
+ }
+
+ buffer.document_insert_event().connect(
+ sigc::mem_fun(*this, &AutoSaver::on_document_insert));
+ buffer.document_remove_event().connect(
+ sigc::mem_fun(*this, &AutoSaver::on_document_remove));
+
+ for(ServerBuffer::document_iterator iter = buffer.document_begin();
+ iter != buffer.document_end(); ++ iter)
+ {
+ on_document_insert(*iter);
+ }
}
Sobby::AutoSaver::~AutoSaver()
@@ -42,12 +59,29 @@
m_conn_timer.disconnect();
}
+void Sobby::AutoSaver::on_document_insert(DocumentInfo& document)
+{
+ document.get_content().changed_event().connect(
+ sigc::mem_fun(*this, &AutoSaver::on_document_change));
+
+ m_has_modification = true;
+}
+
+void Sobby::AutoSaver::on_document_remove(DocumentInfo& document)
+{
+}
+
+void Sobby::AutoSaver::on_document_change()
+{
+ m_has_modification = true;
+}
+
Sobby::AutoSaver::signal_error_type Sobby::AutoSaver::error_event() const
{
return m_signal_error;
}
-bool Sobby::AutoSaver::on_timer()
+void Sobby::AutoSaver::save()
{
try
{
@@ -61,11 +95,30 @@
throw std::runtime_error(std::strerror(errno) );*/
m_buffer.serialise(m_filename);
+ m_has_modification = false;
+
+ if(!m_post_save_hook.empty())
+ {
+ std::vectorstd::string argv;
+ argv.push_back(m_post_save_hook);
+ argv.push_back(m_filename);
+
+ Glib::spawn_async(".", argv);
+ }
}
catch(std::exception& e)
{
m_signal_error.emit(e);
}
+ catch(Glib::Exception& e)
+ {
+ // TODO: Convert to locale?
+ m_signal_error.emit(std::runtime_error(e.what()));
+ }
+}
+bool Sobby::AutoSaver::on_timer()
+{
+ if(m_has_modification) save();
return true;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/src/command_executer.cpp new/sobby-0.4.5/src/command_executer.cpp
--- old/sobby-0.4.4/src/command_executer.cpp 2007-06-16 20:00:21.000000000 +0200
+++ new/sobby-0.4.5/src/command_executer.cpp 2008-09-11 15:12:43.000000000 +0200
@@ -21,6 +21,7 @@
#include
#include
+#include
Sobby::CommandExecuter::CommandExecuter(const Server& server,
ServerBuffer& buffer):
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/src/main.cpp new/sobby-0.4.5/src/main.cpp
--- old/sobby-0.4.4/src/main.cpp 2007-04-14 21:45:53.000000000 +0200
+++ new/sobby-0.4.5/src/main.cpp 2008-09-11 15:12:43.000000000 +0200
@@ -23,10 +23,49 @@
#include
#include "server.hpp"
+#include <csignal>
+#include <cstring>
+#include <cerrno>
+
+namespace
+{
+ Sobby::Server* server_;
+
+ void on_signal_usr1(int sig)
+ {
+ if(server_) server_->save();
+ }
+
+ void on_signal_term(int sig)
+ {
+ if(server_)
+ {
+ server_->save();
+ server_->quit();
+ }
+ }
+}
+
int main(int argc, char* argv[]) try
{
// Create server, parse command line options
Sobby::Server server(argc, argv);
+ // Set global server_ variable for use in signal handler
+ server_ = &server;
+ // Register SIGUSR1 to save session there
+ if(signal(SIGUSR1, on_signal_usr1) != 0)
+ {
+ int save_errno = errno;
+ std::cerr << "Could not register SIGUSR1: "
+ << std::strerror(save_errno) << std::endl;
+ }
+ // Register SIGTERM to save session there
+ if(signal(SIGTERM, on_signal_term) != 0)
+ {
+ int save_errno = errno;
+ std::cerr << "Could not register SIGTERM: "
+ << std::strerror(save_errno) << std::endl;
+ }
// Run it
server.run();
// Success, if no exception has been thrown
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sobby-0.4.4/src/server.cpp new/sobby-0.4.5/src/server.cpp
--- old/sobby-0.4.4/src/server.cpp 2007-08-18 18:20:35.000000000 +0200
+++ new/sobby-0.4.5/src/server.cpp 2008-09-11 15:12:43.000000000 +0200
@@ -71,6 +71,7 @@
std::string autosave_file;
std::string autosave_folder;
int autosave_interval;
+ std::string post_save_hook;
std::string config_file_read;
std::string config_file_write;
@@ -130,6 +131,11 @@
autosave_interval = entry.get_value<unsigned int>(
"autosave_interval", 0
);
+
+ post_save_hook = entry.get_valuestd::string(
+ "post_save_hook", ""
+ );
+
password = entry.get_valueGlib::ustring("password", "");
m_command_dir = entry.get_valueGlib::ustring(
@@ -146,6 +152,7 @@
autosave_folder = "";
autosave_file = "autosave.obby";
autosave_interval = 0;
+ post_save_hook = "";
password = "";
m_command_dir = "";
session = "";
@@ -195,6 +202,14 @@
"Interval (in seconds) between autosaves; 0 disables autosave"
);
+ Glib::OptionEntry opt_common_post_save_hook;
+ opt_common_post_save_hook.set_long_name("post-save-hook");
+ opt_common_post_save_hook.set_arg_description("FILE");
+ opt_common_post_save_hook.set_description(
+ "Executable to be executed every time the file specified "
+ "in autosave-file has been written"
+ );
+
Glib::OptionEntry opt_common_command_dir;
opt_common_command_dir.set_long_name("command-directory");
opt_common_command_dir.set_arg_description("DIRECTORY");
@@ -244,6 +259,11 @@
);
opt_group_common.add_entry_filename(
+ opt_common_post_save_hook,
+ post_save_hook
+ );
+
+ opt_group_common.add_entry_filename(
opt_common_command_dir,
m_command_dir
);
@@ -310,6 +330,11 @@
"autosave_interval", 0
);
+ if(post_save_hook.empty())
+ post_save_hook = entry.get_valuestd::string(
+ "post_save_hook", ""
+ );
+
if(password.empty() )
password = entry.get_valueGlib::ustring(
"password", ""
@@ -330,6 +355,7 @@
if(autosave_folder.empty()) autosave_folder = "";
if(autosave_file.empty() ) autosave_file = "autosave.obby";
if(autosave_interval == 0) autosave_interval = 0;
+ if(post_save_hook.empty()) post_save_hook = "";
if(password.empty() ) password = "";
if(m_command_dir.empty()) m_command_dir = "";
if(session.empty()) session = "";
@@ -349,6 +375,7 @@
entry.set_value("autosave_file", autosave_file);
entry.set_value("autosave_directory", autosave_folder);
entry.set_value("autosave_interval", autosave_interval);
+ entry.set_value("post_save_hook", post_save_hook);
entry.set_value("password", password);
entry.set_value("command_directory", m_command_dir);
entry.set_value("session", session);
@@ -406,41 +433,39 @@
m_server->set_global_password(password);
- if(autosave_interval > 0)
+ if(autosave_folder.empty())
{
- if(autosave_folder.empty())
- {
- m_autosaver.reset(
- new AutoSaver(
- *m_server,
- autosave_file,
- autosave_interval
- )
- );
+ m_autosaver.reset(
+ new AutoSaver(
+ *m_server,
+ autosave_file,
+ autosave_interval,
+ post_save_hook
+ )
+ );
- m_autosaver->error_event().connect(
- sigc::mem_fun(*this, &Server::on_autosave_error) );
- }
- else
+ m_autosaver->error_event().connect(
+ sigc::mem_fun(*this, &Server::on_autosave_error) );
+ }
+ else
+ {
+ if(!Glib::file_test(autosave_folder, Glib::FILE_TEST_IS_DIR))
{
- if(!Glib::file_test(autosave_folder, Glib::FILE_TEST_IS_DIR))
- {
- obby::format_string str("'%0%' is not a directory");
- str << autosave_folder;
- throw std::runtime_error(str.str());
- }
+ obby::format_string str("'%0%' is not a directory");
+ str << autosave_folder;
+ throw std::runtime_error(str.str());
+ }
- m_autosave_folder.reset(
- new AutoSaveFolder(
- *m_server,
- autosave_folder,
- autosave_interval
- )
- );
+ m_autosave_folder.reset(
+ new AutoSaveFolder(
+ *m_server,
+ autosave_folder,
+ autosave_interval
+ )
+ );
- m_autosave_folder->error_event().connect(
- sigc::mem_fun(*this, &Server::on_autosave_error) );
- }
+ m_autosave_folder->error_event().connect(
+ sigc::mem_fun(*this, &Server::on_autosave_error) );
}
m_command_executer.reset(new CommandExecuter(*this, *m_server) );
@@ -512,6 +537,17 @@
m_main_loop->run();
}
+void Sobby::Server::quit()
+{
+ m_main_loop->quit();
+}
+
+void Sobby::Server::save()
+{
+ if(m_autosaver.get()) m_autosaver->save();
+ if(m_autosave_folder.get()) m_autosave_folder->save();
+}
+
bool Sobby::Server::on_stdin(Glib::IOCondition condition)
{
std::string line;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org