[gnome-code-assistance/wip/vala: 4/4] [backends/vala] Simplified namespaces
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-code-assistance/wip/vala: 4/4] [backends/vala] Simplified namespaces
- Date: Mon, 18 Nov 2013 09:00:37 +0000 (UTC)
commit af2b36c6c9e629348fb3ec3f92f718cd5a196b45
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Mon Nov 18 09:59:29 2013 +0100
[backends/vala] Simplified namespaces
backends/vala/dbus.vala | 32 ++++++++++++++++----------------
backends/vala/diagnostics.vala | 9 ++-------
backends/vala/document.vala | 5 -----
backends/vala/service.vala | 7 +------
backends/vala/types.vala | 7 +------
5 files changed, 20 insertions(+), 40 deletions(-)
---
diff --git a/backends/vala/dbus.vala b/backends/vala/dbus.vala
index 1835574..b6ac816 100644
--- a/backends/vala/dbus.vala
+++ b/backends/vala/dbus.vala
@@ -17,15 +17,15 @@
* along with gnome-code-assistance. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace Gca.Backends.Vala.DBus
+namespace DBus
{
[DBus (name = "org.gnome.CodeAssist.v1.Document")]
public class Document : Object
{
- private Gca.Backends.Vala.Document? d_document;
+ private global::Document? d_document;
- public Document(Gca.Backends.Vala.Document? document = null)
+ public Document(global::Document? document = null)
{
d_document = document;
}
@@ -34,9 +34,9 @@ public class Document : Object
[DBus (name = "org.gnome.CodeAssist.v1.Diagnostics")]
public class Diagnostics : Object
{
- private Gca.Backends.Vala.Document? d_document;
+ private global::Document? d_document;
- public Diagnostics(Gca.Backends.Vala.Document? document = null)
+ public Diagnostics(global::Document? document = null)
{
d_document = document;
}
@@ -55,7 +55,7 @@ public class Diagnostics : Object
}
[DBus (name = "org.freedesktop.DBus")]
-interface FreedesktopDBus : Object {
+public interface FreedesktopDBus : Object {
public signal void name_owner_changed(string name, string oldowner, string newowner);
}
@@ -65,25 +65,25 @@ public class Service : Object
class Document
{
public uint id;
- public Gca.Backends.Vala.Document document;
+ public global::Document document;
public ObjectPath path;
- public Gca.Backends.Vala.DBus.Document ddocument;
+ public DBus.Document ddocument;
public uint ddocument_regid;
- public Gca.Backends.Vala.DBus.Diagnostics ddiagnostics;
+ public Diagnostics ddiagnostics;
public uint ddiagnostics_regid;
- public Document(Gca.Backends.Vala.Document document, uint id)
+ public Document(global::Document document, uint id)
{
this.id = id;
this.document = document;
- ddocument = new Gca.Backends.Vala.DBus.Document(document);
+ ddocument = new DBus.Document(document);
ddiagnostics_regid = 0;
- ddiagnostics = new Gca.Backends.Vala.DBus.Diagnostics(document);
+ ddiagnostics = new DBus.Diagnostics(document);
ddiagnostics_regid = 0;
}
}
@@ -92,7 +92,7 @@ public class Service : Object
{
public uint id;
public string name;
- public Gca.Backends.Vala.Service service;
+ public global::Service service;
public Gee.HashMap<string, Document> docs;
public uint nextid;
@@ -101,7 +101,7 @@ public class Service : Object
this.id = id;
this.name = name;
- service = new Gca.Backends.Vala.Service();
+ service = new global::Service();
docs = new Gee.HashMap<string, Document>();
nextid = 0;
@@ -172,7 +172,7 @@ public class Service : Object
private Document make_document(App app, string path, string client_path)
{
- var ndoc = new Gca.Backends.Vala.Document(path);
+ var ndoc = new global::Document(path);
ndoc.client_path = client_path;
var doc = new Document(ndoc, app.nextid);
@@ -285,7 +285,7 @@ public class Service : Object
}
}
-public class Transport
+class Transport
{
private Service d_service;
private MainLoop d_main;
diff --git a/backends/vala/diagnostics.vala b/backends/vala/diagnostics.vala
index 7a5f8a3..e9c7dff 100644
--- a/backends/vala/diagnostics.vala
+++ b/backends/vala/diagnostics.vala
@@ -18,12 +18,9 @@
* along with gnome-code-assistance. If not, see <http://www.gnu.org/licenses/>.
*/
-using global::Vala;
+using Vala;
-namespace Gca.Backends.Vala
-{
-
-public class Diagnostics : Report
+class Diagnostics : Report
{
private Diagnostic[] d_diagnostics;
public string path { get; set; }
@@ -131,6 +128,4 @@ public class Diagnostics : Report
}
}
-}
-
/* vi:ts=4: */
diff --git a/backends/vala/document.vala b/backends/vala/document.vala
index 60387b8..167eb59 100644
--- a/backends/vala/document.vala
+++ b/backends/vala/document.vala
@@ -17,9 +17,6 @@
* along with gnome-code-assistance. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace Gca.Backends.Vala
-{
-
public class Document : Object
{
public string path { get; construct set; }
@@ -35,6 +32,4 @@ public class Document : Object
}
}
-}
-
/* vi:ex:ts=4 */
diff --git a/backends/vala/service.vala b/backends/vala/service.vala
index 0a0c4d0..aa4f2b7 100644
--- a/backends/vala/service.vala
+++ b/backends/vala/service.vala
@@ -18,10 +18,7 @@
* along with gnome-code-assistance. If not, see <http://www.gnu.org/licenses/>.
*/
-using global::Vala;
-
-namespace Gca.Backends.Vala
-{
+using Vala;
public class Service : Object
{
@@ -53,6 +50,4 @@ public class Service : Object
}
}
-}
-
/* vi:ex:ts=4 */
diff --git a/backends/vala/types.vala b/backends/vala/types.vala
index cf80ad3..2a485a2 100644
--- a/backends/vala/types.vala
+++ b/backends/vala/types.vala
@@ -17,9 +17,6 @@
* along with gnome-code-assistance. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace Gca.Backends.Vala
-{
-
public struct SourceLocation
{
public int64 line;
@@ -57,7 +54,7 @@ public struct Fixit
public string replacement;
}
-public enum Severity
+enum Severity
{
NONE,
INFO,
@@ -75,6 +72,4 @@ public struct Diagnostic
public string message;
}
-}
-
/* vi:ex:ts=4 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]