Code cleanup
This commit is contained in:
parent
5bef8dd3cc
commit
a2fb7e163c
|
@ -35,12 +35,8 @@ namespace SparkleLib {
|
|||
if (SparkleConfig.DebugMode)
|
||||
Console.WriteLine (line);
|
||||
|
||||
lock (debug_lock) {
|
||||
File.AppendAllText (
|
||||
SparkleConfig.DefaultConfig.LogFilePath,
|
||||
line + Environment.NewLine
|
||||
);
|
||||
}
|
||||
lock (debug_lock)
|
||||
File.AppendAllText (SparkleConfig.DefaultConfig.LogFilePath, line + Environment.NewLine);
|
||||
}
|
||||
|
||||
|
||||
|
@ -60,7 +56,9 @@ namespace SparkleLib {
|
|||
// Recursively sets access rights of a folder to 'Normal'
|
||||
public static void ClearAttributes (string path)
|
||||
{
|
||||
if (Directory.Exists (path)) {
|
||||
if (!Directory.Exists (path))
|
||||
return;
|
||||
|
||||
string [] folders = Directory.GetDirectories (path);
|
||||
|
||||
foreach (string folder in folders)
|
||||
|
@ -72,7 +70,6 @@ namespace SparkleLib {
|
|||
if (!IsSymlink (file))
|
||||
File.SetAttributes (file, FileAttributes.Normal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if a file is a symbolic link
|
||||
|
@ -93,11 +90,9 @@ namespace SparkleLib {
|
|||
|
||||
public static bool IsWindows {
|
||||
get {
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
|
||||
return (platform == PlatformID.Win32NT ||
|
||||
platform == PlatformID.Win32S ||
|
||||
platform == PlatformID.Win32Windows);
|
||||
return (Environment.OSVersion.Platform == PlatformID.Win32NT ||
|
||||
Environment.OSVersion.Platform == PlatformID.Win32S ||
|
||||
Environment.OSVersion.Platform == PlatformID.Win32Windows);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ namespace SparkleShare {
|
|||
args.RetVal = true;
|
||||
};
|
||||
|
||||
|
||||
DefaultSize = new Gdk.Size (600, 260);
|
||||
Resizable = false;
|
||||
BorderWidth = 0;
|
||||
|
@ -52,8 +51,7 @@ namespace SparkleShare {
|
|||
Title = _("About SparkleShare");
|
||||
AppPaintable = true;
|
||||
|
||||
string image_path = new string [] {SparkleUI.AssetsPath,
|
||||
"pixmaps", "about.png"}.Combine ();
|
||||
string image_path = new string [] { SparkleUI.AssetsPath, "pixmaps", "about.png" }.Combine ();
|
||||
|
||||
Realize ();
|
||||
Gdk.Pixbuf buf = new Gdk.Pixbuf (image_path);
|
||||
|
@ -63,7 +61,6 @@ namespace SparkleShare {
|
|||
|
||||
CreateAbout ();
|
||||
|
||||
|
||||
Controller.HideWindowEvent += delegate {
|
||||
Application.Invoke (delegate {
|
||||
HideAll ();
|
||||
|
@ -80,7 +77,7 @@ namespace SparkleShare {
|
|||
Controller.NewVersionEvent += delegate (string new_version) {
|
||||
Application.Invoke (delegate {
|
||||
this.updates.Markup = String.Format ("<span font_size='small' fgcolor='#729fcf'>{0}</span>",
|
||||
String.Format ("A newer version ({0}) is available!", new_version));
|
||||
string.Format ("A newer version ({0}) is available!", new_version));
|
||||
|
||||
this.updates.ShowAll ();
|
||||
});
|
||||
|
@ -109,17 +106,14 @@ namespace SparkleShare {
|
|||
private void CreateAbout ()
|
||||
{
|
||||
Label version = new Label () {
|
||||
Markup = "<span font_size='small' fgcolor='white'>" +
|
||||
"version " + Controller.RunningVersion +
|
||||
"</span>",
|
||||
Markup = string.Format ("<span font_size='small' fgcolor='white'>version {0}</span>",
|
||||
Controller.RunningVersion),
|
||||
Xalign = 0,
|
||||
Xpad = 300
|
||||
};
|
||||
|
||||
this.updates = new Label () {
|
||||
Markup = "<span font_size='small' fgcolor='#729fcf'>" +
|
||||
"Checking for updates..." +
|
||||
"</span>",
|
||||
Markup = "<span font_size='small' fgcolor='#729fcf'>Checking for updates...</span>",
|
||||
Xalign = 0,
|
||||
Xpad = 300
|
||||
};
|
||||
|
|
|
@ -252,7 +252,7 @@ namespace SparkleShare {
|
|||
this.animation_frame_number = 0;
|
||||
|
||||
this.animation = new Timer () {
|
||||
Interval = 40
|
||||
Interval = 100
|
||||
};
|
||||
|
||||
this.animation.Elapsed += delegate {
|
||||
|
|
Loading…
Reference in a new issue