Merge pull request #1827 from hbons/fix/logs-sharing-violation

Fix/logs sharing violation
This commit is contained in:
Hylke Bons 2018-03-14 23:12:58 +00:00 committed by GitHub
commit 036e5369f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View file

@ -50,8 +50,8 @@ namespace SparkleShare {
var gvfs_set_attribute = new Command ("gvfs-set-attribute", "\"" + Configuration.DefaultConfiguration.FoldersPath + "\" " +
"metadata::custom-icon-name org.sparkleshare.SparkleShare");
gvfs_set_attribute.StartInfo.EnvironmentVariables ["XDG_DATA_HOME"] =
Path.Combine (Config.HomePath, ".local", "share");
string XDG_DATA_HOME = Path.Combine (Config.HomePath, ".local", "share");
gvfs_set_attribute.StartInfo.EnvironmentVariables ["XDG_DATA_HOME"] = XDG_DATA_HOME;
gvfs_set_attribute.StartAndWaitForExit ();
}

View file

@ -24,10 +24,8 @@ using Sparkles;
namespace SparkleShare
{
public class UserInterface
{
public static string AssetsPath = InstallationInfo.Directory;
public StatusIcon StatusIcon;
@ -53,7 +51,8 @@ namespace SparkleShare
application.Register (null);
application.Activated += ApplicationActivatedDelegate;
IconTheme.Default.AppendSearchPath (Path.Combine (UserInterface.AssetsPath, "icons"));
if (IconTheme.Default != null)
IconTheme.Default.AppendSearchPath (Path.Combine (UserInterface.AssetsPath, "icons"));
var label = new Label ();
Gdk.Color color = UserInterfaceHelpers.RGBAToColor (label.StyleContext.GetColor (StateFlags.Insensitive));

View file

@ -52,7 +52,7 @@ namespace Sparkles {
{
string folder = "";
if (!string.IsNullOrEmpty (StartInfo.WorkingDirectory))
if (StartInfo.WorkingDirectory != Path.GetTempPath ())
folder = Path.GetFileName (StartInfo.WorkingDirectory) + " | ";
if (write_output)

View file

@ -22,7 +22,7 @@ namespace Sparkles {
public static class Logger {
static StreamWriter log_writer = File.AppendText (Configuration.DefaultConfiguration.LogFilePath);
static StreamWriter log_writer = File.CreateText (Configuration.DefaultConfiguration.LogFilePath);
static object log_writer_lock = new object ();
@ -63,6 +63,9 @@ namespace Sparkles {
public static void WriteCrashReport (Exception e)
{
if (log_writer != null)
log_writer.Close ();
string home_path = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
if (InstallationInfo.OperatingSystem == OS.Windows)