[gui-dev] Small cosmetic patch for cancelling adding a shared folder

Jens-Uwe Mager <[email protected]> Thu, 15 Jul 2004 16:12:55 +0200
Newsgroups gmane.network.gnutella.limewire.gui.devel
Message-ID <[email protected]>
If one does use the menu option to add a folder to the list of shared
items and one does cancel out of the file dialog box an error is shown
about an invalid directory, potentially confusing the user. The attached
patch fixes this.
-- 
Jens-Uwe Mager	<pgp-mailto:F476EBC2>

_______________________________________________
gui-dev mailing list
[email protected]
http://www.limewire.org/mailman/listinfo/gui-dev
libdir.patch (text/plain, 795 B)
Index: com/limegroup/gnutella/gui/library/LibraryMediator.java
===================================================================
RCS file: /cvs/gui/com/limegroup/gnutella/gui/library/LibraryMediator.java,v
retrieving revision 1.33
diff -u -r1.33 LibraryMediator.java
--- com/limegroup/gnutella/gui/library/LibraryMediator.java	28 May 2004 15:44:35 -0000	1.33
+++ com/limegroup/gnutella/gui/library/LibraryMediator.java	15 Jul 2004 14:00:31 -0000
@@ -184,8 +184,10 @@
 	 */
     public void addSharedLibraryFolder() {
 		File dir = FileChooserHandler.getInputDirectory();
+		if (dir == null)
+		    return;
 
-		if(dir == null || !dir.isDirectory() || !dir.canRead()) {
+		if(!dir.isDirectory() || !dir.canRead()) {
 			GUIMediator.showError("ERROR_INVALID_SHARED_DIRECTORY");
 			return;
 		}