Skip to content

Commit 9b376b2

Browse files
authored
Merge pull request #3084 from quicksilver/pjrobertson/small-tweaks
Various small tweaks based on crash reports
2 parents 6580230 + c799d8e commit 9b376b2

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed

Quicksilver/Code-QuickStepCore/QSLibrarian.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ - (QSObject *)objectWithIdentifier:(NSString *)ident
476476

477477
- (void)setIdentifier:(NSString *)ident forObject:(QSObject *)obj
478478
{
479-
if (ident) {
479+
if (ident && obj) {
480480
[self.objectDictionary setObject:obj forKey:ident];
481481
}
482482
}

Quicksilver/Code-QuickStepCore/QSObject_Pasteboard.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,17 @@ - (void)guessName {
241241
NSString *textString = [data objectForKey:QSTextType];
242242
// some objects (images from the web) don't have a text string but have a URL
243243
if (!textString) {
244-
textString = [data objectForKey:NSPasteboardTypeURL];
244+
id urlObject = [data objectForKey:NSPasteboardTypeURL];
245+
// Handle case where URL might be NSData instead of NSString
246+
if ([urlObject isKindOfClass:[NSData class]]) {
247+
textString = [[NSString alloc] initWithData:urlObject encoding:NSUTF8StringEncoding];
248+
} else if ([urlObject isKindOfClass:[NSString class]]) {
249+
textString = urlObject;
250+
}
251+
}
252+
if ([textString isKindOfClass:[NSString class]]) {
253+
textString = [textString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
245254
}
246-
textString = [textString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
247255

248256
static NSArray *namesAndKeys = nil;
249257

Quicksilver/Code-QuickStepCore/QSPaths.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// URL to crash reporter server/script
3131
#define kCrashReporterURL @"https://qs0.qsapp.com/crashreports/reporter.php"
3232
// Wiki page detailing why we collect crash reports
33-
#define kCrashReportsWikiURL @"https://qsapp.com/wiki/Crash_Reports"
33+
#define kCrashReportsWikiURL @"https://docs.qsapp.com/documentation/supporting-quicksilver/crash_reports"
3434

3535
/**
3636
* Get the path to a subdirectory in the Quicksilver 'Application Support' directory

Quicksilver/Code-QuickStepCore/QSProcessMonitor.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ - (void)appLaunched:(ProcessSerialNumber)psn {
302302
QSObject *procObject = [self imbuedFileProcessForDict:dict];
303303
QSGCDMainAsync(^{
304304
// This notif is used for the Events plugin 'Application Launched' event trigger
305-
[[NSNotificationCenter defaultCenter] postNotificationName:@"QSEventNotification" object:@"QSApplicationLaunchEvent" userInfo:[NSDictionary dictionaryWithObject:procObject forKey:@"object"]];
305+
NSDictionary *userInfo = procObject ? [NSDictionary dictionaryWithObject:procObject forKey:@"object"] : nil;
306+
[[NSNotificationCenter defaultCenter] postNotificationName:@"QSEventNotification" object:@"QSApplicationLaunchEvent" userInfo:userInfo];
306307
[[NSNotificationCenter defaultCenter] postNotificationName:QSProcessMonitorApplicationLaunched object:self userInfo:dict];
307308
});
308309
}

Quicksilver/Resources/CrashReporterText.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<style>
2+
:root {
3+
color-scheme: light dark;
4+
}
5+
div {
6+
color: #000000;
7+
}
8+
@media (prefers-color-scheme: dark) {
9+
div {
10+
color: #ffffff;
11+
}
12+
a {
13+
color: #5ab2ff !important;
14+
}
15+
}
16+
</style>
117
<div style="font-family:'Lucida Grande';font-size:12px;text-align:justify;padding:0px;margin:0px">
218
<p>In order to help improve Quicksilver, please consider sending a crash report to the developers. Quicksilver will restart when this window closes.</p>
319
<p>To troubleshoot your problem, see the <a href="https://qsapp.com/manual/FAQ/" style="text-decoration:underline;color:blue">FAQ</a> or alternatively report your issue on the <a href="https://github.com/quicksilver/Quicksilver/issues" style="text-decoration:underline;color:blue">issue tracker</a>.</p>

Quicksilver/Resources/PluginReporterText.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<style>
2+
:root {
3+
color-scheme: light dark;
4+
}
5+
div {
6+
color: #000000;
7+
}
8+
@media (prefers-color-scheme: dark) {
9+
div {
10+
color: #ffffff;
11+
}
12+
a {
13+
color: #5ab2ff !important;
14+
}
15+
}
16+
</style>
117
<div style="font-family:'Lucida Grande';font-size:12px;text-align:justify;padding:0px;margin:0px">
218
<p>The *** plugin caused Quicksilver to crash, you may wish to delete it.
319
In order to help improve Quicksilver, please consider sending a crash report to the developers. Quicksilver will restart when this window closes.</p>

0 commit comments

Comments
 (0)