Skip to content

Commit

Permalink
Remove some cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtj committed Apr 1, 2009
1 parent 1ed482f commit 3e7a23b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 36 deletions.
3 changes: 0 additions & 3 deletions content/firstrun.js
Expand Up @@ -77,9 +77,6 @@ VALUES (1, "_wiki", "Wikis"); \
',' \
INSERT INTO ServiceSubtypes (s_id, subtype, label) \
VALUES (1, "_printer", "Printers"); \
',' \
INSERT INTO Services (regtype, scheme, label) \
VALUES ("_ssh._tcp.", "ssh://${srv:hostname}:${srv:port}/","SSH"); \
'];
for (i=0;i<dbQueries.length;i++) {
try { DBConn.executeSimpleSQL(dbQueries[i]); }
Expand Down
6 changes: 3 additions & 3 deletions content/regtypes.xul
Expand Up @@ -220,15 +220,15 @@ VALUES (?1, ?2, ?3); ");
<label style="font-weight: bold; font-size: 1.1em;" value="Edit Registration Type"/>
<hbox align="center">
<label style="width: 11em;" value="Registration Type"/>
<textbox flex="1" value="_http._tcp." id="tbRegistrationType" />
<textbox flex="1" id="tbRegistrationType" />
</hbox>
<hbox align="center">
<label style="width: 11em;" value="Label"/>
<textbox flex="1" value="Websites" id="tbLabel" />
<textbox flex="1" id="tbLabel" />
</hbox>
<hbox align="center">
<label style="width: 11em;" value="Scheme"/>
<textbox flex="1" id="tbScheme" value='http://${iftxtvalue:u:${txtvalue:u}}${iftxtvalue:u:${iftxtvalue:p::${txtvalue:p}}}${iftxtvalue:u:@}${srv:hostname}:${srv:port}/${txtvalue:path}' />
<textbox flex="1" id="tbScheme" />
</hbox>
<hbox>
<label style="width: 11em;" value="Subtypes"/>
Expand Down
13 changes: 0 additions & 13 deletions src/manager/dsdmanager.js
@@ -1,27 +1,14 @@
const nsISupports = Components.interfaces.nsISupports;
const IDSDMANAGER = Components.interfaces.IDSDMANAGER;

// You can change these if you like
const CLASS_ID = Components.ID("2a4a57ac-0b06-4fdc-aa3a-f8e4e9195f50");
const CLASS_NAME = "DSDMANAGER";
const CONTRACT_ID = "@andrew.tj.id.au/dsdmanager;1";

// This is your constructor.
// You can do stuff here.
function DSDMANAGER() {
// you can cheat and use this
// while testing without
// writing your own interface
this.wrappedJSObject = this;
this.storageService = Components.classes["@mozilla.org/storage/service;1"]
.getService(Components.interfaces.mozIStorageService);
/*
this.dbFile = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties)
.get("ProfD", Components.interfaces.nsIFile);
this.dbFile.append("testdb.sqlite");
this.DBConn = this.storageService.openDatabase(this.dbFile);
*/
this.DBConn = this.storageService.openDatabase(null);
this.DBConn.executeSimpleSQL(' \
CREATE TABLE DiscoveredDomains ( \
Expand Down
17 changes: 0 additions & 17 deletions src/notifier/bfnotifier.js
Expand Up @@ -25,29 +25,18 @@ BFNotifier.prototype = {
break;

case "profile-after-change":
/*
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(this, "dsd_service_add__http._tcp.", false);
*/
this.prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.getBranch("extensions.bonjourfoxy.");
this.prefs.QueryInterface(Components.interfaces.nsIPrefBranch2);
this.prefs.addObserver("", this, false);
this.displayAlerts = this.prefs.getBoolPref("alerts");
dump (['alerts:',this.displayAlerts,"\n"].join(" "));
this.dsdManager=Components.classes["@andrew.tj.id.au/dsdmanager;1"].getService(Components.interfaces.IDSDMANAGER);
this.alertsService = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService);
this.setHandlers();
break;

case "profile-before-change":
/*
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.removeObserver(this, "dsd_service_add__http._tcp.", false);
*/
this.removeHandlerObservers();
this.prefs.removeObserver("", this);
this.dsdManager = null;
Expand All @@ -63,13 +52,10 @@ BFNotifier.prototype = {
case "alerts":
this.displayAlerts = this.prefs.getBoolPref("alerts");
break;
default:
dump (['nsPref','changed',data,"\n"].join(' '));
}
break;

default:
dump(aTopic + "\n");
if (aTopic.match(/^dsd_service_add/)) {
var newType = aTopic.split(":")[1];
if (this.handlers[newType])
Expand Down Expand Up @@ -125,11 +111,8 @@ GROUP BY Services.regtype, Services.scheme, Services.label; ");
try { var subRegtypes = sqlGetRegTypes.getUTF8String(2).split(','); }
catch (e) { var subRegtypes = []; }
newHandlers[regType] = label;
// this.dsdManager.discoverServices(regType,null);
regtypeSearches.push(regType);
for (var i=0;i<subRegtypes.length;i++) {
// this.dsdManager.discoverServices([regType,subRegtypes[i]].join(','),null);
// dump([regType,subRegtypes[i]].join(',') + "\n");
regtypeSearches.push([regType,subRegtypes[i]].join(','));
}
}
Expand Down

0 comments on commit 3e7a23b

Please sign in to comment.