Skip to content

Commit

Permalink
Fix the .NET 6 build by reverting usage of .NET 7 APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronwhite committed Oct 12, 2023
1 parent 68b8f07 commit 6b94335
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
16 changes: 9 additions & 7 deletions Pinta.Core/Managers/WorkspaceManager.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
//
//
// WorkspaceManager.cs
//
//
// Author:
// Jonathan Pobst <[email protected]>
//
//
// Copyright (c) 2010 Jonathan Pobst
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -107,7 +107,9 @@ public Document CreateAndActivateDocument (Gio.File? file, string? file_type, Si
Document doc = new Document (size);

if (file is not null) {
ArgumentNullException.ThrowIfNullOrEmpty (file_type);
if (string.IsNullOrEmpty (file_type))
throw new ArgumentNullException ($"nameof{file_type} must contain value.");

doc.File = file;
doc.FileType = file_type;
} else
Expand Down
16 changes: 9 additions & 7 deletions Pinta.Gui.Widgets/Widgets/History/HistoryItemWidget.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//
//
// HistoryTreeView.cs
//
//
// Copyright (c) 2010 Jonathan Pobst
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -34,8 +34,10 @@ public class HistoryListViewItem : GObject.Object

public HistoryListViewItem (BaseHistoryItem item) : base (true, Array.Empty<GObject.ConstructArgument> ())
{
ArgumentNullException.ThrowIfNullOrEmpty (item.Text);
ArgumentNullException.ThrowIfNullOrEmpty (item.Icon);
if (string.IsNullOrEmpty (item.Text))
throw new ArgumentNullException ($"nameof{item.Text} must contain value.");
if (string.IsNullOrEmpty (item.Icon))
throw new ArgumentNullException ($"nameof{item.Icon} must contain value.");

this.item = item;
}
Expand Down
16 changes: 9 additions & 7 deletions Pinta/Actions/File/SaveDocumentImplementationAction.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
//
//
// SaveDocumentImplmentationAction.cs
//
//
// Author:
// Jonathan Pobst <[email protected]>
//
//
// Copyright (c) 2010 Jonathan Pobst
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -154,7 +154,9 @@ private static bool SaveFile (Document document, Gio.File? file, FormatDescripto
throw new ArgumentException ("Attempted to save a document with no associated file");

if (format == null) {
ArgumentNullException.ThrowIfNullOrEmpty (document.FileType);
if (string.IsNullOrEmpty (document.FileType))
throw new ArgumentNullException ($"nameof{document.FileType} must contain value.");

format = PintaCore.ImageFormats.GetFormatByExtension (document.FileType);
}

Expand Down

0 comments on commit 6b94335

Please sign in to comment.