summaryrefslogtreecommitdiff
path: root/beos/beos_scaffolding.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-09 01:22:14 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-09 01:22:14 +0000
commit8710d3a8144f33501d73d589f2babedbaf1b53b0 (patch)
tree8637e503d2ec8acf66f283b48d7ac1b91df76cb9 /beos/beos_scaffolding.cpp
parentea205ecf23c1d2b4eb1c2bec6f9f14751106b5be (diff)
downloadnetsurf-8710d3a8144f33501d73d589f2babedbaf1b53b0.tar.gz
netsurf-8710d3a8144f33501d73d589f2babedbaf1b53b0.tar.bz2
- fix for copying selection to clipboard
- fix some leaks - prepare for about box (use about html from rsrc: but it's broken yet) - if more than 1 refs received at the same time, open the extra ones in a new window. svn path=/trunk/netsurf/; revision=5511
Diffstat (limited to 'beos/beos_scaffolding.cpp')
-rw-r--r--beos/beos_scaffolding.cpp73
1 files changed, 43 insertions, 30 deletions
diff --git a/beos/beos_scaffolding.cpp b/beos/beos_scaffolding.cpp
index 1e132e15f..ad1d873cb 100644
--- a/beos/beos_scaffolding.cpp
+++ b/beos/beos_scaffolding.cpp
@@ -327,6 +327,7 @@ void
NSBrowserWindow::MessageReceived(BMessage *message)
{
switch (message->what) {
+ case B_ARGV_RECEIVED:
case B_REFS_RECEIVED:
DetachCurrentMessage();
nsbeos_pipe_message_top(message, this, fScaffolding);
@@ -393,41 +394,53 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
}
case B_REFS_RECEIVED:
{
+ int32 i;
entry_ref ref;
- if (message->FindRef("refs", &ref) < B_OK)
- break;
-
- BString url("file://");
- BPath path(&ref);
- if (path.InitCheck() < B_OK)
- break;
-
- BNode node(path.Path());
- if (node.InitCheck() < B_OK)
- break;
- if (node.IsSymLink()) {
- // dereference the symlink
- BEntry entry(path.Path(), true);
- if (entry.InitCheck() < B_OK)
- break;
- if (entry.GetPath(&path) < B_OK)
- break;
- if (node.SetTo(path.Path()) < B_OK)
+ for (i = 0; message->FindRef("refs", i, &ref) >= B_OK; i++) {
+ BString url("file://");
+ BPath path(&ref);
+ if (path.InitCheck() < B_OK)
break;
- }
- attr_info ai;
- if (node.GetAttrInfo("META:url", &ai) >= B_OK) {
- char data[(size_t)ai.size + 1];
- memset(data, 0, (size_t)ai.size + 1);
- if (node.ReadAttr("META:url", B_STRING_TYPE, 0LL, data, (size_t)ai.size) < 4)
+ BNode node(path.Path());
+ if (node.InitCheck() < B_OK)
break;
- url = data;
- } else
- url << path.Path();
-
- browser_window_go(bw, url.String(), 0, true);
+ if (node.IsSymLink()) {
+ // dereference the symlink
+ BEntry entry(path.Path(), true);
+ if (entry.InitCheck() < B_OK)
+ break;
+ if (entry.GetPath(&path) < B_OK)
+ break;
+ if (node.SetTo(path.Path()) < B_OK)
+ break;
+ }
+
+ attr_info ai;
+ if (node.GetAttrInfo("META:url", &ai) >= B_OK) {
+ char data[(size_t)ai.size + 1];
+ memset(data, 0, (size_t)ai.size + 1);
+ if (node.ReadAttr("META:url", B_STRING_TYPE, 0LL, data, (size_t)ai.size) < 4)
+ break;
+ url = data;
+ } else
+ url << path.Path();
+
+ if (/*message->WasDropped() &&*/ i == 0)
+ browser_window_go(bw, url.String(), 0, true);
+ else
+ browser_window_create(url.String(), bw, NULL, false, false);
+ }
+ break;
+ }
+ case B_ARGV_RECEIVED:
+ {
+ int32 i;
+ BString url;
+ for (i = 1; message->FindString("argv", i, &url) >= B_OK; i++) {
+ browser_window_create(url.String(), bw, NULL, false, false);
+ }
break;
}
case B_COPY: