Index: beos/TRApplication.h
===================================================================
--- beos/TRApplication.h	(revision 1504)
+++ beos/TRApplication.h	(working copy)
@@ -27,6 +27,7 @@
 		virtual void Pulse();
 		virtual void ReadyToRun();
 		virtual void RefsReceived(BMessage *message);
+		virtual void ArgvReceived(int32 _argc, char** _argv);
 		virtual bool QuitRequested();
 
 		virtual void MessageReceived(BMessage *message);
Index: beos/TRInfoWindow.h
===================================================================
--- beos/TRInfoWindow.h	(revision 1504)
+++ beos/TRInfoWindow.h	(working copy)
@@ -11,7 +11,7 @@
 
 class TRInfoWindow : public BWindow {
 public:
-	TRInfoWindow(tr_stat_t status);
+	TRInfoWindow(tr_stat_t *status, tr_info_t *info, char *folder);
 	~TRInfoWindow();
 	
 	virtual void FrameResized(float width, float height);
Index: beos/TRTransfer.h
===================================================================
--- beos/TRTransfer.h	(revision 1504)
+++ beos/TRTransfer.h	(working copy)
@@ -13,32 +13,24 @@
 
 class TRTransfer : public BListItem {
 public: // Construction and Controll methods.
-	TRTransfer(const char *fullpath, node_ref node);
+	TRTransfer(const char *fullpath, node_ref node, tr_torrent_t *torrentRef);
 	~TRTransfer();
 
 	inline node_ref GetCachedNodeRef() { return cachedNodeRef; };
 	inline const char* GetCachedPath() { return cachedPath->String(); };
+	inline tr_torrent_t* GetTorrent()  { return torrent; };
 	
-	bool SetStatus(tr_stat_t *stat, bool shade);
+	bool UpdateStatus(tr_stat_t *stat, bool shade);
+	bool IsRunning();
 	
 public: // BListItem
 	virtual void Update(BView *owner, const BFont *font);
 	virtual void DrawItem(BView *owner, BRect frame, bool complete = false);
 
 private: 
-	/* 
-	 * Cached data. The items stored here are _NOT_ necessairly
-	 * the torrent we'll be rendering. It's likely they will be,
-	 * but NOT guaranteed. They are not used for anything relating
-	 * to rendering.
-	 * 
-	 * Specifically we needed a way to cache the node_ref and
-	 * reverse-lookup the node from the string path in the 
-	 * transmission structs. This seemed the logical place to store
-	 * that information, since it ends up in a BList(View).
-	 */
 	node_ref cachedNodeRef;
 	BString *cachedPath;
+	tr_torrent_t *torrent;
 
 private: // Private members used for rendering.
 	float fBaselineOffset;
@@ -46,6 +38,7 @@
 	
 	BLocker *fStatusLock;
 	tr_stat_t *fStatus;
+	BString *fName;
 	
 	rgb_color fBarColor;
 	
Index: beos/TRWindow.h
===================================================================
--- beos/TRWindow.h	(revision 1504)
+++ beos/TRWindow.h	(working copy)
@@ -6,6 +6,7 @@
 #include <Entry.h>
 #include <FilePanel.h>
 #include <ListView.h>
+#include <ListItem.h>
 #include <Window.h>
 
 #include "transmission.h"
@@ -41,8 +42,8 @@
 	
 	void LoadSettings();
 	
-	void StopTorrent(int index);
-	void StartTorrent(int index);
+	void StopTorrent(tr_torrent_t *torrent);
+	void StartTorrent(tr_torrent_t *torrent);
 	
 	static int32 AsynchStopTorrent(void *data);
 	static int32 AsynchStartTorrent(void *data);
@@ -50,20 +51,41 @@
 	void RescanTorrents();
 
 private:
-	BListView *transfers;
+	static BListView *transfers;
 	BFilePanel *openPanel;
 	
 	tr_handle_t *engine;
 	
 	TRPrefsWindow *fSettings;
+	
+	static bool RemovePath(BListItem *item, void *data);
+	static bool CheckQuitStatus(BListItem *item, void *data);
+	static bool UpdateStats(BListItem *item, void *data);
 };
 
 /**
  * Used to pass info off to the worker thread that runs AsynchStopTorrent
  */
 struct worker_info {
+	TRWindow     *window;
+	tr_torrent_t *torrent;
+};
+
+struct remove_info {
 	TRWindow *window;
-	int      index;
+	char     path[B_FILE_NAME_LENGTH];
 };
 
+struct quit_info {
+	TRWindow *window;
+	int       running;
+};
+
+struct update_info {
+	TRWindow *window;
+	bool     running;
+	int      selected;
+	int      invalid;
+};
+
 #endif /* TR_WIND */
Index: beos/TRApplication.cpp
===================================================================
--- beos/TRApplication.cpp	(revision 1504)
+++ beos/TRApplication.cpp	(working copy)
@@ -219,7 +219,7 @@
 		}
 	}
 	
-	be_app_messenger.SendMessage(refs);
+	be_app_messenger.SendMessage(&refs);
 }
 
 /**
Index: beos/TRInfoWindow.cpp
===================================================================
--- beos/TRInfoWindow.cpp	(revision 1504)
+++ beos/TRInfoWindow.cpp	(working copy)
@@ -11,7 +11,7 @@
 #include <stdio.h>
 
 
-TRInfoWindow::TRInfoWindow(tr_stat_t status) : BWindow(BRect(0, 0, 250, 175), "Info", 
+TRInfoWindow::TRInfoWindow(tr_stat_t *status, tr_info_t *info, char *folder) : BWindow(BRect(0, 0, 250, 175), "Info", 
                           B_FLOATING_WINDOW, B_ASYNCHRONOUS_CONTROLS | /*B_NOT_RESIZABLE*/  B_NOT_ZOOMABLE,
                           B_CURRENT_WORKSPACE)
 {
@@ -22,13 +22,13 @@
 	headerFont.SetSize(14.0f);
 	font_height fh;
 	headerFont.GetHeight(&fh);
-	if (headerFont.StringWidth(status.info.name) > Bounds().Width() - 10) {
-		ResizeBy(headerFont.StringWidth(status.info.name) - Bounds().Width() + 10, 0);
+	if (headerFont.StringWidth(info->name) > Bounds().Width() - 10) {
+		ResizeBy(headerFont.StringWidth(info->name) - Bounds().Width() + 10, 0);
 	}
 	
 	viewRect = Bounds();
 	viewRect.bottom = fh.ascent + fh.descent;
-	BStringView *strView = new BStringView(viewRect, "header", status.info.name, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
+	BStringView *strView = new BStringView(viewRect, "header", info->name, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
 	strView->SetFont(&headerFont);
 	strView->SetAlignment(B_ALIGN_CENTER);
 	
@@ -38,32 +38,32 @@
 	BTextView *txtView = new BTextView(viewRect, "infoText", viewRect, B_FOLLOW_LEFT | B_FOLLOW_TOP);
 	txtView->MakeEditable(false);
 	
-	BString strTracker(status.info.trackerAddress);
-	strTracker << ":" << status.info.trackerPort;
+	BString strTracker(status->trackerAddress);
+	strTracker << ":" << status->trackerPort;
 
 	BString strPieceSize("");
-	StringForFileSize(status.info.pieceSize, &strPieceSize);
+	StringForFileSize(info->pieceSize, &strPieceSize);
 
 	BString strTotalSize("");
-	StringForFileSize(status.info.totalSize, &strTotalSize);
+	StringForFileSize(info->totalSize, &strTotalSize);
 
 	BString strDownloaded("");
-	StringForFileSize(status.downloaded, &strDownloaded);
+	StringForFileSize(status->downloaded, &strDownloaded);
 
 	BString strUploaded("");
-	StringForFileSize(status.uploaded, &strUploaded);
+	StringForFileSize(status->uploaded, &strUploaded);
 
-	BString info("");
-	info << "Tracker: " << strTracker << "\n"
-	     << "Announce: " << status.info.trackerAnnounce << "\n"
-	     << "Piece Size: " << strPieceSize << "\n"
-	     << "Pieces: " << status.info.pieceCount << "\n"
-	     << "Total Size: " << strTotalSize << "\n"
-	     << "\n"
-	     << "Folder: " << status.folder << "\n"
-	     << "Downloaded: " << strDownloaded << "\n"
-	     << "Uploaded: " << strUploaded << "\n";
-	txtView->SetText(info.String());
+	BString infoStr("");
+	infoStr << "Tracker: " << strTracker << "\n"
+	        << "Announce: " << status->trackerAnnounce << "\n"
+	        << "Piece Size: " << strPieceSize << "\n"
+	        << "Pieces: " << info->pieceCount << "\n"
+	        << "Total Size: " << strTotalSize << "\n"
+	        << "\n"
+	        << "Folder: " << folder << "\n"
+	        << "Downloaded: " << strDownloaded << "\n"
+	        << "Uploaded: " << strUploaded << "\n";
+	txtView->SetText(infoStr.String());
 	
 	Lock();
 	AddChild(strView);
Index: beos/TRTransfer.cpp
===================================================================
--- beos/TRTransfer.cpp	(revision 1504)
+++ beos/TRTransfer.cpp	(working copy)
@@ -10,14 +10,18 @@
 /**
  * BListItem that renders Transfer status.
  */
-TRTransfer::TRTransfer(const char *fullpath, node_ref node) : BListItem(0, false), cachedNodeRef(node) {
+TRTransfer::TRTransfer(const char *fullpath, node_ref node, tr_torrent_t *torrentRef) : BListItem(0, false), cachedNodeRef(node) {
 	fBaselineOffset = 0.0f;
 	fLineSpacing = 0.0f;
+	torrent = torrentRef;
 	
 	cachedPath = new BString(fullpath);
 	fStatusLock = new BLocker("Status Locker", true);
 	
 	fStatus = (tr_stat_t*)calloc(1, sizeof(tr_stat_t));
+	tr_info_t *info = tr_torrentInfo(torrent);
+	fName = new BString("<unknown name>");
+	fName->SetTo(info->name);
 	
 	fBarColor.red = 50;
 	fBarColor.green = 150;
@@ -36,6 +40,7 @@
 		delete fStatusLock;
 	}
 	delete cachedPath;
+	delete fName;
 }
 
 
@@ -64,7 +69,7 @@
  * This is a thread-safe function, as all writing to the 
  * local fStatus requires a successful Lock on fStatusLock.
  */
-bool TRTransfer::SetStatus(tr_stat_t *stat, bool shade) {
+bool TRTransfer::UpdateStatus(tr_stat_t *stat, bool shade) {
 	bool dirty = false;
 	if (fStatusLock->Lock()) {
 		if (fStatus->status != stat->status ||
@@ -81,7 +86,13 @@
 	return dirty;
 }
 
+bool TRTransfer::IsRunning() {
+	return (fStatus != NULL && 
+			(fStatus->status &
+			          (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED)));
+}
 
+
 /**
  * Renders (Draws) the current status into the BListView.
  */
@@ -110,7 +121,7 @@
 	textLoc += BPoint(2, fBaselineOffset);
 	
 	if (fStatus != NULL && fStatusLock->Lock()) {
-		owner->DrawString(fStatus->info.name, textLoc);
+		owner->DrawString(fName->String(), textLoc);
 		
 		if (fStatus->status & TR_STATUS_PAUSE ) {
 			sprintf(fTimeStr, "Paused (%.2f %%)", 100 * fStatus->progress);
Index: beos/TRWindow.cpp
===================================================================
--- beos/TRWindow.cpp	(revision 1504)
+++ beos/TRWindow.cpp	(working copy)
@@ -20,6 +20,8 @@
 #include "TRTransfer.h"
 #include "TRInfoWindow.h"
 
+BListView *TRWindow::transfers = NULL;
+
 /**
  * The Transmission Window! Yay!
  */
@@ -72,8 +74,8 @@
 	
 	// Setup the transfers ListView
 	viewRect.Set(2, menubar->Frame().bottom + 3, rectFrame->Width() - 2 - B_V_SCROLL_BAR_WIDTH, rectFrame->Height() - 2);
-	transfers = new BListView(viewRect, "TorrentList", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL);
-	transfers->SetSelectionMessage(new BMessage(TR_SELECT));
+	TRWindow::transfers = new BListView(viewRect, "TorrentList", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL);
+	TRWindow::transfers->SetSelectionMessage(new BMessage(TR_SELECT));
 	AddChild(new BScrollView("TransferScroller", transfers, B_FOLLOW_ALL, 0, false, true));
 	
 	Unlock();
@@ -112,7 +114,7 @@
 			uploadLimit = 20;
 			prefs.SetInt32("transmission.uploadLimit", uploadLimit);
 		}
-		tr_setUploadLimit(engine, (int)uploadLimit);
+		tr_setGlobalUploadLimit(engine, (int)uploadLimit);
 	}
 }
 
@@ -157,9 +159,10 @@
 			torrent->GetPath(&path);
 			
 			// Try adding the torrent to the engine.
-			int addStatus = tr_torrentInit(engine, path.Path());
-			if (addStatus == 0 && Lock()) { // Success. Add the TRTorrent item.
-				transfers->AddItem(new TRTransfer(path.Path(), node));
+			int error;
+			tr_torrent_t *nTorrent = tr_torrentInit(engine, path.Path(), 0, &error);
+			if (nTorrent != NULL && Lock()) { // Success. Add the TRTorrent item.
+				transfers->AddItem(new TRTransfer(path.Path(), node, nTorrent));
 				
 				bool autoStart = true;
 				
@@ -177,13 +180,13 @@
 					// Start the newly added torrent.
 					worker_info *startData = (worker_info*)calloc(1, sizeof(worker_info));
 					startData->window = this;
-					startData->index = tr_torrentCount(engine) - 1;
+					startData->torrent = nTorrent;
 					thread_id start_thread = spawn_thread(TRWindow::AsynchStartTorrent, "BirthCanal",
 					                                      B_NORMAL_PRIORITY, (void *)startData);
 					if (!((start_thread) < B_OK)) {
 						resume_thread(start_thread);
 					} else { // Fallback and start the old way.
-						StartTorrent(startData->index);
+						StartTorrent(startData->torrent);
 						free(startData);
 					}
 				}
@@ -250,36 +253,28 @@
 				 * IS NOT the index of the torrent in the engine. These are
 				 * Totally decoupled, due to the way transmission is written.
 				 */
-				char path[B_FILE_NAME_LENGTH];
+				remove_info *removeData = (remove_info*)calloc(1, sizeof(remove_info));
+				removeData->window = this;
 				TRTransfer* item;
 				for (int32 i = 0; i < transfers->CountItems(); i++) {
 					item = (TRTransfer*)transfers->ItemAt(i);
 					if (item->GetCachedNodeRef() == node) {
-						strcpy(path, item->GetCachedPath());
+						strcpy(removeData->path, item->GetCachedPath());
 					}
 				}
 				
-				// Look for the torrent info in the engine with the matching
-				// path name.
-				tr_stat_t *stats;
-				int max = tr_torrentStat(engine, &stats);
-				int index;
-				for (index = 0; index < max; index++) {
-					if (strcmp(stats[index].info.torrent, path) == 0) {
-						tr_torrentClose(engine, index);
-						transfers->RemoveItem(index);
-						break;
-					}
-				}
-				free(stats);
+				transfers->DoForEach(TRWindow::RemovePath, (void *)removeData);
+				
+				free(removeData);
 			}
 		}
 	} else if (msg->what == TR_INFO) {
 		// Display an Info Window.
-		tr_stat_t *s;
-		tr_torrentStat(engine, &s);
+		TRTransfer *transfer = dynamic_cast<TRTransfer*>(transfers->ItemAt(transfers->CurrentSelection()));
+		tr_stat_t *s = tr_torrentStat(transfer->GetTorrent());
+		tr_info_t *i = tr_torrentInfo(transfer->GetTorrent());
 		
-		TRInfoWindow *info = new TRInfoWindow(s[transfers->CurrentSelection()]);
+		TRInfoWindow *info = new TRInfoWindow(s, i, tr_torrentGetFolder(transfer->GetTorrent()));
 		info->MoveTo(Frame().LeftTop() + BPoint(20, 25));
 		info->Show();
 	} else if (msg->what == TR_SELECT) {
@@ -290,34 +285,33 @@
 	} else if (msg->what == TR_RESUME) {
 		worker_info *startData = (worker_info*)calloc(1, sizeof(worker_info));
 		startData->window = this;
-		startData->index = (int)transfers->CurrentSelection();
+		startData->torrent = (dynamic_cast<TRTransfer*>(transfers->ItemAt(transfers->CurrentSelection())))->GetTorrent();
 		thread_id start_thread = spawn_thread(TRWindow::AsynchStartTorrent, "BirthCanal",
 		                                      B_NORMAL_PRIORITY, (void *)startData);
 		if (!((start_thread) < B_OK)) {
 			resume_thread(start_thread);
 		} else { // Fallback and start the old way.
-			StartTorrent(startData->index);
+			StartTorrent(startData->torrent);
 			free(startData);
 		}
 	} else if (msg->what == TR_PAUSE) {
 		worker_info *stopData = (worker_info*)calloc(1, sizeof(worker_info));
 		stopData->window = this;
-		stopData->index = (int)transfers->CurrentSelection();
+		stopData->torrent = (dynamic_cast<TRTransfer*>(transfers->ItemAt(transfers->CurrentSelection())))->GetTorrent();
 		thread_id stop_thread = spawn_thread(TRWindow::AsynchStopTorrent, "InUtero",
 		                                     B_NORMAL_PRIORITY, (void *)stopData);
 		if (!((stop_thread) < B_OK)) {
 			resume_thread(stop_thread);
 		} else { // Fallback and stop it the old way.
-			StopTorrent(stopData->index);
+			StopTorrent(stopData->torrent);
 			free(stopData);
 		}
 	} else if (msg->what == TR_REMOVE) {
 		int32 index = transfers->CurrentSelection();
 		
-		tr_torrentClose(engine, (int)index);
-		
 		// Remove the file from the filesystem.
 		TRTransfer *item = (TRTransfer*)transfers->RemoveItem(index);
+		tr_torrentClose(engine, item->GetTorrent());
 		BEntry *entry = new BEntry(item->GetCachedPath(), true);
 		entry->Remove();
 		delete entry;
@@ -341,19 +335,14 @@
 bool TRWindow::QuitRequested() {
 	bool quit = false;
 	
-	bool running = false;
-	tr_stat_t *s;
-	int max = tr_torrentStat(engine, &s);
-	for (int i = 0; i < max && !running; i++) {
-		running = (s[i].status &
-		          (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED));
-	}
-	free(s);
+	quit_info *quitData = (quit_info*)calloc(1, sizeof(quit_info));
+	quitData->running = 0;
+	transfers->DoForEach(TRWindow::CheckQuitStatus, (void *)quitData);
 	
-	if (running) {
+	if (quitData->running > 0) {
 		BString quitMsg("");
-		quitMsg << "There's " << max << " torrent";
-		if (max > 1) {
+		quitMsg << "There's " << quitData->running << " torrent";
+		if (quitData->running > 1) {
 			quitMsg << "s";
 		}
 		quitMsg << " currently running.\n"
@@ -366,23 +355,27 @@
 	} else {
 		quit = true;
 	}
+	free(quitData);
 	
 	if (quit) {
 		Prefs *prefs = new Prefs(TRANSMISSION_SETTINGS);
 		prefs->SetRect("window.frame", Frame());
 		
 		BString strItem("");
-		for (int i = 0; i < tr_torrentStat(engine, &s); i++) {
+		for (int i = 0; i < transfers->CountItems(); i++) {
 			strItem = "download.";
-			strItem << s[i].info.torrent << ".running";
-			if (s[i].status & (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED)) {
+			tr_torrent_t *torrent = (dynamic_cast<TRTransfer*>(transfers->ItemAt(i)))->GetTorrent(); 
+			tr_info_t *info = tr_torrentInfo(torrent);
+			tr_stat_t *stat = tr_torrentStat(torrent);
+			
+			strItem << info->torrent << ".running";
+			if (stat->status & (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED)) {
 				prefs->SetBool(strItem.String(), true);
-				tr_torrentStop(engine, i);
+				tr_torrentStop(torrent);
 			} else {
 				prefs->SetBool(strItem.String(), false);
 			}
 		}
-		free(s);
 		delete prefs;
 		
 		be_app->PostMessage(new BMessage(B_QUIT_REQUESTED));
@@ -398,16 +391,16 @@
 /**
  * Called from the StopTorrent thread.
  */
-void TRWindow::StopTorrent(int index) {
-	tr_torrentStop(engine, index);
+void TRWindow::StopTorrent(tr_torrent_t *torrent) {
+	tr_torrentStop(torrent);
 	
-	UpdateList(index, true);
+	UpdateList(transfers->CurrentSelection(), true);
 }
 
 /**
  * Called from StartTorrent thread.
  */
-void TRWindow::StartTorrent(int index) {
+void TRWindow::StartTorrent(tr_torrent_t *torrent) {
 	// Read the settings.
 	BString folder("");
 	Prefs *prefs = new Prefs(TRANSMISSION_SETTINGS);
@@ -415,11 +408,11 @@
 		prefs->SetString("download.folder", "/boot/home/Downloads");
 		folder << "/boot/home/Downloads";
 	}
-	tr_torrentSetFolder(engine, index, folder.String());
-	tr_torrentStart(engine, index);
+	tr_torrentSetFolder(torrent, folder.String());
+	tr_torrentStart(torrent);
 	
 	if (transfers->CurrentSelection() >= 0) {
-		UpdateList(index, true);
+		UpdateList(transfers->CurrentSelection(), true);
 	}
 	
 	delete prefs;
@@ -431,47 +424,37 @@
  * and invalidate the view.
  */
 void TRWindow::UpdateList(int32 selection = -1, bool menus = true) {
-	bool running = false;
+	update_info *upData = (update_info*)calloc(1, sizeof(update_info));
+	upData->running = false;
+	upData->selected = selection;
+	upData->invalid = 0;
 	
-	tr_stat_t * s;
-	int i = 0;
-	int max = tr_torrentStat(engine, &s);
-	bool invalid[max];
+	transfers->DoForEach(TRWindow::UpdateStats, (void *)upData);
 	
-	for (i = 0; i < max; i++) {
-		invalid[i] = ((TRTransfer*)transfers->ItemAt(i))->SetStatus(&(s[i]), (i % 2 != 0));
-		
-		if (menus && i == (int)selection) {
-			running = (s[selection].status & 
-			          (TR_STATUS_CHECK | TR_STATUS_DOWNLOAD | TR_STATUS_SEED));
-		}
-	}
-	free(s);
-	
 	if (menus) {
 		KeyMenuBar()->FindItem(TR_INFO)->SetEnabled(selection >= 0);
-		KeyMenuBar()->FindItem(TR_RESUME)->SetEnabled(selection >= 0 && !running);
-		KeyMenuBar()->FindItem(TR_PAUSE)->SetEnabled(selection >= 0 && running);
-		KeyMenuBar()->FindItem(TR_REMOVE)->SetEnabled(selection >= 0 && !running);
+		KeyMenuBar()->FindItem(TR_RESUME)->SetEnabled(selection >= 0 && !upData->running);
+		KeyMenuBar()->FindItem(TR_PAUSE)->SetEnabled(selection >= 0 && upData->running);
+		KeyMenuBar()->FindItem(TR_REMOVE)->SetEnabled(selection >= 0 && !upData->running);
 	}
 	
-	if (Lock()) {
-		for (i = 0; i < max; i++) {
-			if (invalid[i]) {
-				transfers->InvalidateItem(i);
-			}
-		}
-		Unlock();
+	if (upData->invalid > 0 && transfers->LockLooper()) {
+		transfers->Invalidate();
+		transfers->UnlockLooper();
 	}
+	
+	free(upData);
 }
 
+
+
 /**
  * Thread Function to stop Torrents. This can be expensive and causes the event loop to
  * choke.
  */
 int32 TRWindow::AsynchStopTorrent(void *data) {
 	worker_info* stopData = (worker_info*)data;
-	stopData->window->StopTorrent(stopData->index);
+	stopData->window->StopTorrent(stopData->torrent);
 	free(stopData);
 	return B_OK;
 }
@@ -482,7 +465,56 @@
  */
 int32 TRWindow::AsynchStartTorrent(void *data) {
 	worker_info* startData = (worker_info*)data;
-	startData->window->StartTorrent(startData->index);
+	startData->window->StartTorrent(startData->torrent);
 	free(startData);
 	return B_OK;
 }
+
+/**
+ * Invoked by DoForEach upon the transfers list. This will
+ * remove the item that is caching the path specified by 
+ * path.
+ */
+bool TRWindow::RemovePath(BListItem *item, void *data) {
+	remove_info* removeData = (remove_info*)data;
+	TRTransfer *transfer = dynamic_cast<TRTransfer*>(item);
+	
+	if (strcmp(transfer->GetCachedPath(), removeData->path) == 0) {
+		removeData->window->transfers->RemoveItem(transfer);
+		return true;
+	}
+	return false;
+}
+
+/**
+ * Invoked during QuitRequested, iterates all Transfers and 
+ * checks to see how many are running.
+ */
+bool TRWindow::CheckQuitStatus(BListItem *item, void *data) {
+	quit_info* quitData = (quit_info*)data;
+	TRTransfer *transfer = dynamic_cast<TRTransfer*>(item);
+	
+	if (transfer->IsRunning()) {
+		quitData->running++;
+	}
+	return false;
+}
+
+/**
+ * Invoked during UpdateList()
+ */
+bool TRWindow::UpdateStats(BListItem *item, void *data) {
+	update_info* upData = (update_info*)data;
+	TRTransfer *transfer = dynamic_cast<TRTransfer*>(item);
+	
+	int32 index = transfers->IndexOf(transfer);
+	if (transfer->UpdateStatus(tr_torrentStat(transfer->GetTorrent()), index % 2 == 0)) {
+		upData->invalid++;
+	}
+	
+	if (index == upData->selected) {
+		upData->running = transfer->IsRunning();
+	}
+	
+	return false;
+}
\ No newline at end of file
Index: mk/beos.mk
===================================================================
--- mk/beos.mk	(revision 1504)
+++ mk/beos.mk	(working copy)
@@ -3,19 +3,19 @@
 include ../mk/config.mk
 include ../mk/common.mk
 
-SRCS = TRApplication.cpp TRWindow.cpp TRTransfer.cpp \
-       TRPrefsWindow.cpp TRInfoWindow.cpp
+SRCS = ../beos/TRApplication.cpp ../beos/TRWindow.cpp ../beos/TRTransfer.cpp \
+       ../beos/TRPrefsWindow.cpp ../beos/TRInfoWindow.cpp
 OBJS = $(SRCS:%.cpp=%.o)
 
-CXXFLAGS += -I../libtransmission
+CXXFLAGS += -I../libtransmission -I../beos/libPrefs
 LDLIBS   += ../libtransmission/libtransmission.a
 CXXFLAGS += -IlibPrefs
 LDFLAGS  += -lbe -ltracker
-LDLIBS   += libPrefs/libPrefs.a
+LDLIBS   += ../beos/libPrefs/libPrefs.a
 
-Transmission: $(OBJS) Transmission.rsrc
+Transmission: $(OBJS) ../beos/Transmission.rsrc
 	$(CXX) -o $@ $(OBJS) $(LDLIBS) $(LDFLAGS)
-	xres -o Transmission Transmission.rsrc
+	xres -o Transmission ../beos/Transmission.rsrc
 	mimeset -f Transmission
 
 %.o: %.cpp ../mk/config.mk ../mk/common.mk ../mk/beos.mk

