Fix build with mono < 2.8 (use Path.Combine (string []))
This commit is contained in:
parent
3212f6c2b1
commit
3752ff9e04
|
@ -53,8 +53,8 @@ namespace SparkleShare {
|
||||||
Title = _("About SparkleShare");
|
Title = _("About SparkleShare");
|
||||||
AppPaintable = true;
|
AppPaintable = true;
|
||||||
|
|
||||||
string image_path = System.IO.Path.Combine (SparkleUI.AssetsPath,
|
string image_path = System.IO.Path.Combine (new string {SparkleUI.AssetsPath,
|
||||||
"pixmaps", "about.png");
|
"pixmaps", "about.png"});
|
||||||
|
|
||||||
Realize ();
|
Realize ();
|
||||||
Gdk.Pixbuf buf = new Gdk.Pixbuf (image_path);
|
Gdk.Pixbuf buf = new Gdk.Pixbuf (image_path);
|
||||||
|
|
|
@ -246,7 +246,7 @@ namespace SparkleShare {
|
||||||
if (name == null)
|
if (name == null)
|
||||||
return GetLog ();
|
return GetLog ();
|
||||||
|
|
||||||
string path = Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, name);
|
string path = Path.Combine (new string [] {SparkleConfig.DefaultConfig.FoldersPath, name});
|
||||||
int log_size = 50;
|
int log_size = 50;
|
||||||
|
|
||||||
foreach (SparkleRepoBase repo in Repositories) {
|
foreach (SparkleRepoBase repo in Repositories) {
|
||||||
|
@ -351,7 +351,8 @@ namespace SparkleShare {
|
||||||
if (change_set.Edited.Count > 0) {
|
if (change_set.Edited.Count > 0) {
|
||||||
foreach (string file_path in change_set.Edited) {
|
foreach (string file_path in change_set.Edited) {
|
||||||
string absolute_file_path = Path.Combine (
|
string absolute_file_path = Path.Combine (
|
||||||
SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder, file_path);
|
new string [] {SparkleConfig.DefaultConfig.FoldersPath,
|
||||||
|
change_set.Folder, file_path});
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd class='document edited'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='document edited'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
|
@ -363,7 +364,8 @@ namespace SparkleShare {
|
||||||
if (change_set.Added.Count > 0) {
|
if (change_set.Added.Count > 0) {
|
||||||
foreach (string file_path in change_set.Added) {
|
foreach (string file_path in change_set.Added) {
|
||||||
string absolute_file_path = Path.Combine (
|
string absolute_file_path = Path.Combine (
|
||||||
SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder, file_path);
|
new string [] {SparkleConfig.DefaultConfig.FoldersPath,
|
||||||
|
change_set.Folder, file_path});
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd class='document added'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='document added'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
|
@ -375,7 +377,8 @@ namespace SparkleShare {
|
||||||
if (change_set.Deleted.Count > 0) {
|
if (change_set.Deleted.Count > 0) {
|
||||||
foreach (string file_path in change_set.Deleted) {
|
foreach (string file_path in change_set.Deleted) {
|
||||||
string absolute_file_path = Path.Combine (
|
string absolute_file_path = Path.Combine (
|
||||||
SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder, file_path);
|
new string [] {SparkleConfig.DefaultConfig.FoldersPath,
|
||||||
|
change_set.Folder, file_path});
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd class='document deleted'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='document deleted'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
|
@ -388,10 +391,14 @@ namespace SparkleShare {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (string file_path in change_set.MovedFrom) {
|
foreach (string file_path in change_set.MovedFrom) {
|
||||||
string to_file_path = change_set.MovedTo [i];
|
string to_file_path = change_set.MovedTo [i];
|
||||||
|
|
||||||
string absolute_file_path = Path.Combine (
|
string absolute_file_path = Path.Combine (
|
||||||
SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder, file_path);
|
new string [] {SparkleConfig.DefaultConfig.FoldersPath,
|
||||||
|
change_set.Folder, file_path});
|
||||||
|
|
||||||
string absolute_to_file_path = Path.Combine (
|
string absolute_to_file_path = Path.Combine (
|
||||||
SparkleConfig.DefaultConfig.FoldersPath, change_set.Folder, file_path);
|
new string [] {SparkleConfig.DefaultConfig.FoldersPath,
|
||||||
|
change_set.Folder, file_path});
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd class='document moved'><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>";
|
event_entry += "<dd class='document moved'><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>";
|
||||||
|
@ -895,8 +902,8 @@ namespace SparkleShare {
|
||||||
List<string> old_avatars = new List<string> ();
|
List<string> old_avatars = new List<string> ();
|
||||||
bool avatar_fetched = false;
|
bool avatar_fetched = false;
|
||||||
string avatar_path = Path.Combine (
|
string avatar_path = Path.Combine (
|
||||||
Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath), "icons",
|
new string [] {Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath), "icons",
|
||||||
size + "x" + size, "status");
|
size + "x" + size, "status"});
|
||||||
|
|
||||||
if (!Directory.Exists (avatar_path)) {
|
if (!Directory.Exists (avatar_path)) {
|
||||||
Directory.CreateDirectory (avatar_path);
|
Directory.CreateDirectory (avatar_path);
|
||||||
|
|
|
@ -214,20 +214,20 @@ namespace SparkleShare {
|
||||||
html = html.Replace ("<!-- $secondary-font-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
|
html = html.Replace ("<!-- $secondary-font-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
|
||||||
html = html.Replace ("<!-- $small-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
|
html = html.Replace ("<!-- $small-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
|
||||||
html = html.Replace ("<!-- $no-buddy-icon-background-image -->", "file://" +
|
html = html.Replace ("<!-- $no-buddy-icon-background-image -->", "file://" +
|
||||||
System.IO.Path.Combine (SparkleUI.AssetsPath, "icons",
|
System.IO.Path.Combine (new string [] {SparkleUI.AssetsPath, "icons",
|
||||||
"hicolor", "32x32", "status", "avatar-default.png"));
|
"hicolor", "32x32", "status", "avatar-default.png"}));
|
||||||
html = html.Replace ("<!-- $document-added-background-image -->", "file://" +
|
html = html.Replace ("<!-- $document-added-background-image -->", "file://" +
|
||||||
System.IO.Path.Combine (SparkleUI.AssetsPath, "icons",
|
System.IO.Path.Combine (new string [] {SparkleUI.AssetsPath, "icons",
|
||||||
"hicolor", "12x12", "status", "document-added.png"));
|
"hicolor", "12x12", "status", "document-added.png"}));
|
||||||
html = html.Replace ("<!-- $document-edited-background-image -->", "file://" +
|
html = html.Replace ("<!-- $document-edited-background-image -->", "file://" +
|
||||||
System.IO.Path.Combine (SparkleUI.AssetsPath, "icons",
|
System.IO.Path.Combine (new string [] {SparkleUI.AssetsPath, "icons",
|
||||||
"hicolor", "12x12", "status", "document-edited.png"));
|
"hicolor", "12x12", "status", "document-edited.png"}));
|
||||||
html = html.Replace ("<!-- $document-deleted-background-image -->", "file://" +
|
html = html.Replace ("<!-- $document-deleted-background-image -->", "file://" +
|
||||||
System.IO.Path.Combine (SparkleUI.AssetsPath, "icons",
|
System.IO.Path.Combine (new string [] {SparkleUI.AssetsPath, "icons",
|
||||||
"hicolor", "12x12", "status", "document-deleted.png"));
|
"hicolor", "12x12", "status", "document-deleted.png"}));
|
||||||
html = html.Replace ("<!-- $document-moved-background-image -->", "file://" +
|
html = html.Replace ("<!-- $document-moved-background-image -->", "file://" +
|
||||||
System.IO.Path.Combine (SparkleUI.AssetsPath, "icons",
|
System.IO.Path.Combine (new string [] {SparkleUI.AssetsPath, "icons",
|
||||||
"hicolor", "12x12", "status", "document-moved.png"));
|
"hicolor", "12x12", "status", "document-moved.png"}));
|
||||||
|
|
||||||
Application.Invoke (delegate {
|
Application.Invoke (delegate {
|
||||||
this.spinner.Stop ();
|
this.spinner.Stop ();
|
||||||
|
|
|
@ -73,10 +73,11 @@ namespace SparkleShare {
|
||||||
// from the Internet category if needed
|
// from the Internet category if needed
|
||||||
public override void InstallLauncher ()
|
public override void InstallLauncher ()
|
||||||
{
|
{
|
||||||
string apps_path = Path.Combine (SparkleConfig.DefaultConfig.HomePath,
|
string apps_path = Path.Combine (
|
||||||
".local", "share", "applications");
|
new string [] {SparkleConfig.DefaultConfig.HomePath,
|
||||||
|
".local", "share", "applications"});
|
||||||
|
|
||||||
string desktopfile_path = SparkleHelpers.CombineMore (apps_path, "sparkleshare.desktop");
|
string desktopfile_path = Path.Combine (apps_path, "sparkleshare.desktop");
|
||||||
|
|
||||||
if (!File.Exists (desktopfile_path)) {
|
if (!File.Exists (desktopfile_path)) {
|
||||||
if (!Directory.Exists (apps_path))
|
if (!Directory.Exists (apps_path))
|
||||||
|
@ -135,8 +136,9 @@ namespace SparkleShare {
|
||||||
Directory.CreateDirectory (SparkleConfig.DefaultConfig.FoldersPath);
|
Directory.CreateDirectory (SparkleConfig.DefaultConfig.FoldersPath);
|
||||||
SparkleHelpers.DebugInfo ("Controller", "Created '" + SparkleConfig.DefaultConfig.FoldersPath + "'");
|
SparkleHelpers.DebugInfo ("Controller", "Created '" + SparkleConfig.DefaultConfig.FoldersPath + "'");
|
||||||
|
|
||||||
string gvfs_command_path = Path.Combine (Path.VolumeSeparatorChar.ToString (),
|
string gvfs_command_path = Path.Combine (
|
||||||
"usr", "bin", "gvfs-set-attribute");
|
new string [] {Path.VolumeSeparatorChar.ToString (),
|
||||||
|
"usr", "bin", "gvfs-set-attribute"});
|
||||||
|
|
||||||
// Add a special icon to the SparkleShare folder
|
// Add a special icon to the SparkleShare folder
|
||||||
if (File.Exists (gvfs_command_path)) {
|
if (File.Exists (gvfs_command_path)) {
|
||||||
|
@ -166,8 +168,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override string EventLogHTML {
|
public override string EventLogHTML {
|
||||||
get {
|
get {
|
||||||
string path = Path.Combine (Defines.PREFIX,
|
string path = Path.Combine (new string [] {Defines.PREFIX,
|
||||||
"share", "sparkleshare", "html", "event-log.html");
|
"share", "sparkleshare", "html", "event-log.html"});
|
||||||
|
|
||||||
string html = String.Join (Environment.NewLine, File.ReadAllLines (path));
|
string html = String.Join (Environment.NewLine, File.ReadAllLines (path));
|
||||||
|
|
||||||
|
@ -181,8 +183,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override string DayEntryHTML {
|
public override string DayEntryHTML {
|
||||||
get {
|
get {
|
||||||
string path = Path.Combine (Defines.PREFIX,
|
string path = Path.Combine (new string [] {Defines.PREFIX,
|
||||||
"share", "sparkleshare", "html", "day-entry.html");
|
"share", "sparkleshare", "html", "day-entry.html"});
|
||||||
|
|
||||||
return String.Join (Environment.NewLine, File.ReadAllLines (path));
|
return String.Join (Environment.NewLine, File.ReadAllLines (path));
|
||||||
}
|
}
|
||||||
|
@ -191,8 +193,8 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override string EventEntryHTML {
|
public override string EventEntryHTML {
|
||||||
get {
|
get {
|
||||||
string path = Path.Combine (Defines.PREFIX,
|
string path = Path.Combine (new string [] {Defines.PREFIX,
|
||||||
"share", "sparkleshare", "html", "event-entry.html");
|
"share", "sparkleshare", "html", "event-entry.html"});
|
||||||
|
|
||||||
return String.Join (Environment.NewLine, File.ReadAllLines (path));
|
return String.Join (Environment.NewLine, File.ReadAllLines (path));
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,8 @@ namespace SparkleShare {
|
||||||
public static SparkleBubbles Bubbles;
|
public static SparkleBubbles Bubbles;
|
||||||
public static SparkleSetup Setup;
|
public static SparkleSetup Setup;
|
||||||
public static SparkleAbout About;
|
public static SparkleAbout About;
|
||||||
public static string AssetsPath = Path.Combine (Defines.PREFIX, "share", "sparkleshare");
|
public static string AssetsPath = Path.Combine (
|
||||||
|
new string [] {Defines.PREFIX, "share", "sparkleshare"});
|
||||||
|
|
||||||
|
|
||||||
// Short alias for the translations
|
// Short alias for the translations
|
||||||
|
|
Loading…
Reference in a new issue