Revision: 42201
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42201&view=rev
Author:   brlcad
Date:     2011-01-13 02:42:26 +0000 (Thu, 13 Jan 2011)

Log Message:
-----------
remove brlcadDataPath since you really don't want to look for '.' unless you 
absolutely have to, otherwise you risk getting a non-usable /usr/brlcad 
default.  looking for the subdirectories individually makes them try the 
run-time relative path first, which means we don't even need to try a separate 
'src' search unless it's for items that are in a different place hierarchically 
in the source tree than they are after install.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/Archer.tcl
    brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl

Modified: brlcad/trunk/src/tclscripts/archer/Archer.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/Archer.tcl       2011-01-13 02:31:01 UTC 
(rev 42200)
+++ brlcad/trunk/src/tclscripts/archer/Archer.tcl       2011-01-13 02:42:26 UTC 
(rev 42201)
@@ -39,6 +39,8 @@
 
     set pluginsdir [file join [bu_brlcad_data "plugins"] archer]
     if {![file exists $pluginsdir]} {
+       # searching 'src' is only necessary for items installed to a
+       # different hierarchy.
        set pluginsdir [file join [bu_brlcad_data "src"] archer plugins]
     }
 
@@ -723,6 +725,9 @@
     set pluginPath [file join [bu_brlcad_data "plugins"] archer]
     if { ![file exists $pluginPath] } {
        # try a source dir invocation
+
+       # searching 'src' is only necessary for items installed to a
+       # different hierarchy.
        set pluginPath [file join [bu_brlcad_data "src"] archer plugins]
     }
     if { ![file exists $pluginPath] } {
@@ -2957,10 +2962,7 @@
     } {}
 
     # About Info
-    set imgfile [file join $brlcadDataPath tclscripts archer images 
aboutArcher.png]
-    if { ![file exists $imgfile] } {
-       set imgfile [file join [bu_brlcad_data "src"] tclscripts archer images 
aboutArcher.png]
-    }
+    set imgfile [file join [bu_brlcad_data "tclscripts"] archer images 
aboutArcher.png]
     set aboutImg [image create photo -file $imgfile]
     itk_component add aboutInfo {
        ::ttk::label $itk_component(aboutDialogTabs).aboutInfo \
@@ -2978,7 +2980,7 @@
            -textbackground $SystemButtonFace
     } {}
 
-    set brlcadLicenseFile [file join $brlcadDataPath COPYING]
+    set brlcadLicenseFile [file join [bu_brlcad_data "."] COPYING]
     if {![catch {open $brlcadLicenseFile "r"} fd]} {
        set brlcadLicenseInfo [read $fd]
        close $fd
@@ -2997,7 +2999,7 @@
            -textbackground $SystemButtonFace
     } {}
 
-    set ackFile [file join $brlcadDataPath doc archer_ack.txt]
+    set ackFile [file join [bu_brlcad_data "doc"] archer_ack.txt]
     if {![catch {open $ackFile "r"} fd]} {
        set ackInfo [read $fd]
        close $fd
@@ -3010,15 +3012,7 @@
     } {}
 
     # try installed, uninstalled
-    set imgfile [file join $brlcadDataPath tclscripts mged mike-tux.png]
-    if { ![file exists $imgfile] } {
-       # try src tree
-       set imgfile [file join [bu_brlcad_data "src"] tclscripts mged 
mike-tux.png]
-       if { ![file exists $imgfile] } {
-           # try local relative
-           set imgfile [file join tclscripts mged mike-tux.png]
-       }
-    }
+    set imgfile [file join [bu_brlcad_data "tclscripts"] mged mike-tux.png]
     set mikeImg [image create photo -file $imgfile]
     itk_component add mikePic {
        ::label $itk_component(mikeF).pic \
@@ -3046,7 +3040,7 @@
            -textbackground $SystemButtonFace
     } {}
 
-    set mikeInfoFile [file join $brlcadDataPath tclscripts mged 
mike-dedication.txt]
+    set mikeInfoFile [file join [bu_brlcad_data "tclscripts"] mged 
mike-dedication.txt]
     if {![catch {open $mikeInfoFile "r"} fd]} {
        set mikeInfo [read -nonewline $fd]
        close $fd
@@ -3115,7 +3109,7 @@
 
 
 proc Archer::mkHelpTkImage {file} {
-    set fullpath [file join $brlcadDataPath html manuals mged $file]
+    set fullpath [file join [bu_brlcad_data "html"] manuals mged $file]
     set name [image create photo -file $fullpath]
     return [list $name [list image delete $name]]
 }

Modified: brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2011-01-13 02:31:01 UTC 
(rev 42200)
+++ brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2011-01-13 02:42:26 UTC 
(rev 42201)
@@ -73,7 +73,6 @@
        common OBJ_EDIT_VIEW_MODE 0
        common OBJ_ATTR_VIEW_MODE 1
 
-       common brlcadDataPath
        common SystemWindowFont
        common SystemWindowText
        common SystemWindow
@@ -240,7 +239,6 @@
        method Z                   {args}
        method zap                 {args}
 
-       set brlcadDataPath [bu_brlcad_data "."]
        if {$tcl_platform(platform) != "windows"} {
            set SystemWindowFont Helvetica
            set SystemWindowText black
@@ -822,11 +820,7 @@
        set env(DISPLAY) ":0"
     }
 
-    set mImgDir [file join $brlcadDataPath tclscripts archer images]
-    if { ![file exists $mImgDir] } {
-       set path [bu_brlcad_data "src"]
-       set mImgDir [file join $path tclscripts archer images]
-    }
+    set mImgDir [file join [bu_brlcad_data "tclscripts"] archer images]
 
     if {[llength $args] == 1} {
        set args [lindex $args 0]


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to