Skip to content

Commit

Permalink
Use OSEDefaults and OSEFileManager classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
trunkmaster committed Jan 3, 2025
1 parent 8945649 commit c069315
Show file tree
Hide file tree
Showing 63 changed files with 182 additions and 1,203 deletions.
4 changes: 2 additions & 2 deletions Applications/Login/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#import <GNUstepGUI/GSDisplayServer.h>
#import <AppKit/AppKit.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <DesktopKit/NXTAlert.h>
#import <SystemKit/OSEScreen.h>
#import <SystemKit/OSEPower.h>
Expand Down Expand Up @@ -72,7 +72,7 @@ extern LoginExitCode panelExitCode;
OSEPower *systemPower;

// Preferences
NXTDefaults *prefs;
OSEDefaults *prefs;

// User sessions
NSArray *mainThreadPorts;
Expand Down
2 changes: 1 addition & 1 deletion Applications/Login/Controller.m
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ - (void)awakeFromNib
[panelImageView setRefusesFirstResponder:YES];

// Open preferences
prefs = [[NXTDefaults alloc] initWithSystemDefaults];
prefs = [[OSEDefaults alloc] initWithSystemDefaults];

[hostnameField retain];
[self displayHostname];
Expand Down
10 changes: 5 additions & 5 deletions Applications/Login/Login_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
#include <X11/extensions/Xrandr.h>

#import <AppKit/NSApplication.h>
#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <SystemKit/OSEScreen.h>
#import <SystemKit/OSEDisplay.h>
#import <SystemKit/OSEPower.h>

#import "Controller.h"

static NSTask *xorgTask = nil;
static NXTDefaults *loginDefaults = nil;
static OSEDefaults *loginDefaults = nil;

//-----------------------------------------------------------------------------
// --- Plymouth
Expand Down Expand Up @@ -218,9 +218,9 @@ static void handleSignal(int sig)
[NSApp stop:nil];
}

NXTDefaults *getDefaults(NSString *appPath)
OSEDefaults *getDefaults(NSString *appPath)
{
NXTDefaults *systemDefaults;
OSEDefaults *systemDefaults;
id serverCommand;
NSString *defaultsPath;
NSDictionary *defaults;
Expand All @@ -230,7 +230,7 @@ static void handleSignal(int sig)
return loginDefaults;
}

systemDefaults = [NXTDefaults systemDefaults];
systemDefaults = [OSEDefaults systemDefaults];
serverCommand = [systemDefaults objectForKey:@"WindowServerCommand"];

// User defaults is not correct
Expand Down
6 changes: 3 additions & 3 deletions Applications/Login/Preferences/Login.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#import <AppKit/NSTextField.h>
#import <AppKit/NSImageView.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>

#import <Preferences.h>

Expand All @@ -47,8 +47,8 @@
IBOutlet NSButton *displayHostname;
IBOutlet NSButton *saveLastLoggedIn;

NXTDefaults *defaults;
NXTDefaults *systemDefaults;
OSEDefaults *defaults;
OSEDefaults *systemDefaults;
BOOL isAdminUser;
}

Expand Down
4 changes: 2 additions & 2 deletions Applications/Login/Preferences/Login.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (id)init

self = [super init];

defaults = [[NXTDefaults alloc] initDefaultsWithPath:NSUserDomainMask
defaults = [[OSEDefaults alloc] initDefaultsWithPath:NSUserDomainMask
domain:@"Login"];

bundle = [NSBundle bundleForClass:[self class]];
Expand Down Expand Up @@ -135,7 +135,7 @@ - (BOOL)_isAdminUser

- (void)awakeFromNib
{
systemDefaults = [[NXTDefaults alloc]
systemDefaults = [[OSEDefaults alloc]
initDefaultsWithPath:NSSystemDomainMask
domain:@"Login"];

Expand Down
6 changes: 3 additions & 3 deletions Applications/Preferences/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
//

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <SystemKit/OSEKeyboard.h>
#import <SystemKit/OSEMouse.h>
#import <SystemKit/OSEScreen.h>
Expand Down Expand Up @@ -77,7 +77,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotif
// NSApplication removed arguments (-NXAutoLaunch YES) to omit flickering.
// We've just finished launching and not active == we've autolaunched
if ([NSApp isActive] == NO) {
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];

NSLog(@"Configuring Keyboard...");
[OSEKeyboard configureWithDefaults:defs];
Expand Down Expand Up @@ -106,7 +106,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende

- (void)applicationWillTerminate:(NSNotification *)aNotif
{
[[NXTDefaults globalUserDefaults] synchronize];
[[OSEDefaults globalUserDefaults] synchronize];
[prefsController release];
[clockView removeFromSuperviewWithoutNeedingDisplay];
}
Expand Down
4 changes: 2 additions & 2 deletions Applications/Preferences/Modules/Date/Date.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#import <AppKit/AppKit.h>
#import <DesktopKit/NXTClockView.h>
#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <Preferences.h>
#import "Calendar.h"

Expand All @@ -41,7 +41,7 @@
NSImage *image;
NSImage *handImage;

NXTDefaults *defaults;
OSEDefaults *defaults;
}

@end
2 changes: 1 addition & 1 deletion Applications/Preferences/Modules/Date/Date.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (id)init
imagePath = [bundle pathForResource:@"Date" ofType:@"tiff"];
image = [[NSImage alloc] initWithContentsOfFile:imagePath];

defaults = [NXTDefaults globalUserDefaults];
defaults = [OSEDefaults globalUserDefaults];

return self;
}
Expand Down
4 changes: 2 additions & 2 deletions Applications/Preferences/Modules/Display/Display.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#import <AppKit/NSMatrix.h>
#import <AppKit/NSSlider.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <DesktopKit/NXTNumericField.h>

#import <SystemKit/OSEScreen.h>
Expand Down Expand Up @@ -336,7 +336,7 @@ - (IBAction)backgroundChanged:(id)sender
if ([systemScreen setBackgroundColorRed:[rgbColor redComponent]
green:[rgbColor greenComponent]
blue:[rgbColor blueComponent]] == YES) {
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];
NSDictionary *dBack;

dBack = @{@"Red": [NSNumber numberWithFloat:[color redComponent]],
Expand Down
4 changes: 2 additions & 2 deletions Applications/Preferences/Modules/Expert/Expert.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#import <AppKit/NSImage.h>
#import <Preferences.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>

@interface Expert: NSObject <PrefsModule>
{
Expand All @@ -34,7 +34,7 @@
id privateWindowServerBtn;
id privateSoundServerBtn;

NXTDefaults *defaults;
OSEDefaults *defaults;
NSImage *image;
}

Expand Down
12 changes: 6 additions & 6 deletions Applications/Preferences/Modules/Expert/Expert.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//

#import <AppKit/AppKit.h>
#import <DesktopKit/NXTFileManager.h>
#import <SystemKit/OSEFileManager.h>

#import "Expert.h"

Expand All @@ -30,7 +30,7 @@ - (id)init
{
self = [super init];

defaults = [NXTDefaults globalUserDefaults];
defaults = [OSEDefaults globalUserDefaults];
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *imagePath = [bundle pathForResource:@"Expert" ofType:@"tiff"];
image = [[NSImage alloc] initWithContentsOfFile:imagePath];
Expand Down Expand Up @@ -59,9 +59,9 @@ - (void)awakeFromNib
[privateSoundServerBtn setRefusesFirstResponder:YES];

[sortByBtn
selectItemWithTag:[[NXTFileManager defaultManager] sortFilesBy]];
selectItemWithTag:[[OSEFileManager defaultManager] sortFilesBy]];
[showHiddenFilesBtn
setState:[[NXTFileManager defaultManager] isShowHiddenFiles]];
setState:[[OSEFileManager defaultManager] isShowHiddenFiles]];
}

- (NSView *)view
Expand Down Expand Up @@ -94,12 +94,12 @@ - (NSImage *)buttonImage

- (void)setSortBy:(id)sender
{
[[NXTFileManager defaultManager] setSortFilesBy:[[sender selectedItem] tag]];
[[OSEFileManager defaultManager] setSortFilesBy:[[sender selectedItem] tag]];
}

- (void)setShowHiddenFiles:(id)sender
{
[[NXTFileManager defaultManager] setShowHiddenFiles:[sender state]];
[[OSEFileManager defaultManager] setShowHiddenFiles:[sender state]];
}

@end
Expand Down
22 changes: 11 additions & 11 deletions Applications/Preferences/Modules/Keyboard/Keyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
#import <AppKit/NSMatrix.h>
#import <AppKit/NSWindow.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <SystemKit/OSEKeyboard.h>

#import "Keyboard.h"

@implementation Keyboard

static NSBundle *bundle = nil;
static NXTDefaults *defaults = nil;
static OSEDefaults *defaults = nil;

- (id)init
{
self = [super init];

defaults = [NXTDefaults globalUserDefaults];
defaults = [OSEDefaults globalUserDefaults];

bundle = [NSBundle bundleForClass:[self class]];
NSString *imagePath = [bundle pathForResource:@"Keyboard" ofType:@"tiff"];
Expand Down Expand Up @@ -294,7 +294,7 @@ - (NSString *)_optionWithType:(NSString *)type

- (BOOL)_setOption:(NSString *)option
{
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];
NSMutableArray *mOptions = [options mutableCopy];
NSArray *optComponents;
NSString *savedOption;
Expand Down Expand Up @@ -335,7 +335,7 @@ @implementation Keyboard (KeyRepeat)

- (void)repeatAction:(id)sender
{
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];

if (sender == initialRepeatMtrx)
{ // NXKeyboard-InitialKeyRepeat - delay in milliseconds before repeat
Expand All @@ -357,7 +357,7 @@ @implementation Keyboard (Layouts)

- (void)updateLayouts
{
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];

if (layouts) {
[layouts release];
Expand Down Expand Up @@ -473,7 +473,7 @@ - (void)initSwitchLayoutShortcuts
[layoutShortcutBtn selectItemWithTitle:@"None"];

// Refresh defaults with actual X11 settings
[[NXTDefaults globalUserDefaults] setObject:options forKey:OSEKeyboardOptions];
[[OSEDefaults globalUserDefaults] setObject:options forKey:OSEKeyboardOptions];
}

- (void)updateSwitchLayoutShortcuts
Expand All @@ -498,7 +498,7 @@ - (void)updateSwitchLayoutShortcuts
// Replaces "NXKeyboardOptions" array item that contains "grp:" substring.
- (void)setLayoutShortcut:(id)sender
{
NXTDefaults *defs = [NXTDefaults globalUserDefaults];
OSEDefaults *defs = [OSEDefaults globalUserDefaults];
NSMutableArray *mOptions = [options mutableCopy];
id selectedOption;
BOOL isOptionReplaced = NO;
Expand Down Expand Up @@ -577,7 +577,7 @@ - (void)initNumpad

NSInteger numLockState;

numLockState = [[NXTDefaults globalUserDefaults] integerForKey:OSEKeyboardNumLockState];
numLockState = [[OSEDefaults globalUserDefaults] integerForKey:OSEKeyboardNumLockState];
[numLockStateMtrx selectCellWithTag:numLockState];
if ([[numpadMtrx selectedCell] tag] != 2 )
[keyboard setNumLockState:numLockState];
Expand Down Expand Up @@ -621,7 +621,7 @@ - (void)numpadMtrxClicked:(id)sender

- (void)numLockMtrxClicked:(id)sender
{
[[NXTDefaults globalUserDefaults] setInteger:[[sender selectedCell] tag]
[[OSEDefaults globalUserDefaults] setInteger:[[sender selectedCell] tag]
forKey:OSEKeyboardNumLockState];
[keyboard setNumLockState:[[sender selectedCell] tag]];
}
Expand Down Expand Up @@ -872,7 +872,7 @@ - (void)modelBrowserClicked:(id)sender
[modelDescription setStringValue:model[modelKey]];
// Save setting to NXGlobalDomain
[keyboard setModel:modelKey];
[[NXTDefaults globalUserDefaults] setObject:modelKey
[[OSEDefaults globalUserDefaults] setObject:modelKey
forKey:OSEKeyboardModel];
}
else {
Expand Down
4 changes: 2 additions & 2 deletions Applications/Preferences/Modules/Sound/Sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
//

#import <AppKit/NSImage.h>
#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <SoundKit/SoundKit.h>

#import <Preferences.h>

@interface Sound: NSObject <PrefsModule>
{
NXTDefaults *defaults;
OSEDefaults *defaults;
NSImage *image;
SNDServer *soundServer;
SNDOut *soundOut;
Expand Down
2 changes: 1 addition & 1 deletion Applications/Preferences/Modules/Sound/Sound.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (id)init

self = [super init];

defaults = [NXTDefaults globalUserDefaults];
defaults = [OSEDefaults globalUserDefaults];

bundle = [NSBundle bundleForClass:[self class]];
imagePath = [bundle pathForResource:@"Sound" ofType:@"tiff"];
Expand Down
2 changes: 1 addition & 1 deletion Applications/Preferences/PrefsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#import <AppKit/NSScroller.h>
#import <AppKit/NSButton.h>

#import <DesktopKit/NXTDefaults.h>
#import <SystemKit/OSEDefaults.h>
#import <DesktopKit/NXTBundle.h>

#import "PrefsController.h"
Expand Down
Loading

0 comments on commit c069315

Please sign in to comment.