Ticket #4446: patch

File patch, 12.1 KB (added by stpere, 11 years ago)
  • build/jam/HaikuImage

    diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage
    index 84af617..409edf3 100644
    a b AddFilesToHaikuImage system add-ons media : $(SYSTEM_ADD_ONS_MEDIA) ;  
    648648AddFilesToHaikuImage system add-ons media plugins
    649649    : $(SYSTEM_ADD_ONS_MEDIA_PLUGINS) ;
    650650AddFilesToHaikuImage system add-ons Tracker
    651     : FileType-F Mark\ as… Mark\ as\ Read-R Open\ Target\ Folder-O
    652     Open\ Terminal-T ZipOMatic-Z ;
     651    : FileType Mark\ as… Mark\ as\ Read Open\ Target\ Folder
     652    Open\ Terminal ZipOMatic ;
    653653AddSymlinkToHaikuImage system add-ons Tracker
    654     : /boot/system/preferences/Backgrounds : Background-B ;
     654    : /boot/system/preferences/Backgrounds : Background ;
    655655AddSymlinkToHaikuImage system add-ons Tracker
    656     : /boot/system/apps/TextSearch : TextSearch-G ;
     656    : /boot/system/apps/TextSearch : TextSearch ;
    657657AddSymlinkToHaikuImage system add-ons Tracker
    658     : /boot/system/apps/DiskUsage : DiskUsage-I ;
     658    : /boot/system/apps/DiskUsage : DiskUsage ;
     659AddAttributeToHaikuImage system add-ons Tracker
     660    : Background : string : _trk/shortcut : B ;
     661AddAttributeToHaikuImage system add-ons Tracker
     662    : TextSearch : string : _trk/shortcut : G ;
     663AddAttributeToHaikuImage system add-ons Tracker
     664    : DiskUsage : string : _trk/shortcut : I ;
     665AddAttributeToHaikuImage system add-ons Tracker
     666    : FileType : string : _trk/shortcut : F ;
     667AddAttributeToHaikuImage system add-ons Tracker
     668    : Open\ Terminal : string : _trk/shortcut : T ;
     669AddAttributeToHaikuImage system add-ons Tracker
     670    : Open\ Target\ Folder : string : _trk/shortcut : O ;
     671AddAttributeToHaikuImage system add-ons Tracker
     672    : Mark\ as\ Read : string : _trk/shortcut : R ;
     673AddAttributeToHaikuImage system add-ons Tracker
     674    : ZipOMatic : string : _trk/shortcut : Z ;
    659675AddFilesToHaikuImage system add-ons input_server devices
    660676    : <input>keyboard <input>mouse <input>tablet <input>wacom ;
    661677AddFilesToHaikuImage system add-ons input_server filters
  • build/jam/ImageRules

    diff --git a/build/jam/ImageRules b/build/jam/ImageRules
    index dea629b..3ec27a1 100644
    a b rule FFilesInContainerDirectory container : directoryTokens  
    216216    return ;
    217217}
    218218
     219rule AddAttributeToContainer container : directoryTokens : file : attrType
     220    : attrName : value
     221{
     222    local containerGrist =
     223        [ on $(HAIKU_IMAGE_CONTAINER_NAME) return $(HAIKU_CONTAINER_GRIST) ] ;
     224
     225    local directory = [ AddDirectoryToContainer $(container)
     226        : $(directoryTokens) ] ;
     227
     228    directory = $(directory:G=$(containerGrist)) ;
     229
     230    local attribute = $(directory)/$(file) ;
     231    ATTR_NAME on $(attribute) = $(attrName) ;
     232    ATTR_TYPE on $(attribute) = $(attrType) ;
     233    ATTR_VALUE on $(attribute) = $(value) ;
     234    ATTRIBUTES_TO_INSTALL on $(directory) += $(attribute) ;
     235}
     236
    219237rule AddSymlinkToContainer container : directoryTokens : linkTarget : linkName
    220238{
    221239    # AddSymlinkToContainer <container> : <directory> : <link target>
    rule CreateContainerCopyFilesScript container : script  
    550568            AddDirectoryToContainerCopyFilesScript $(targetDir)
    551569                : $(initScript) ;
    552570        }
     571
     572        local attributes = [ on $(dir) return $(ATTRIBUTES_TO_INSTALL) ] ;
     573        local attribute ;
     574        for attribute in $(attributes) {
     575            Depends $(script) : $(attribute) ;
     576            Depends $(attribute) : $(initScript) $(serializationDependency) ;
     577            AddAttributeToContainerCopyFilesScript $(attribute)
     578                : $(initScript) ;
     579        }
    553580    }
    554581}
    555582
    actions AddSymlinkToContainerCopyFilesScript  
    573600    echo \$ln -sfn "\"$(SYMLINK_TARGET)\"" "\"\${tPrefix}$(1:G=)\"" >> $(2[1])
    574601}
    575602
     603actions AddAttributeToContainerCopyFilesScript
     604{
     605    echo tempAttrs=\"\$tmpDir/$(1:B)\" >> $(2[1])
     606    echo \$rmAttrs -f \"\$tempAttrs\" >> $(2[1])
     607    echo touch \"\$tempAttrs\" >> $(2[1])
     608    echo \$addattr -t $(ATTR_TYPE) $(ATTR_NAME) $(ATTR_VALUE) \"\$tempAttrs\" >> $(2[1])
     609    echo \$copyAttrs \"\${sPrefix}\$tempAttrs\" "\"\${tPrefix}$(1:G=)\"" >> $(2[1])
     610}
    576611
    577612actions AddDirectoryToContainerCopyFilesScript
    578613{
    rule AddSymlinkToHaikuImage directoryTokens : linkTarget : linkName  
    693728        : $(linkTarget) : $(linkName) ;
    694729}
    695730
     731rule AddAttributeToHaikuImage directoryTokens : file : attrType : attrName : value
     732{
     733    AddAttributeToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(directoryTokens)
     734        : $(file) : $(attrType) : $(attrName) : $(value) ;
     735}
     736
    696737rule FSymlinksInHaikuImageDirectory directoryTokens
    697738{
    698739    return [ FSymlinksInContainerDirectory $(HAIKU_IMAGE_CONTAINER_NAME)
  • src/add-ons/tracker/filetype/Jamfile

    diff --git a/src/add-ons/tracker/filetype/Jamfile b/src/add-ons/tracker/filetype/Jamfile
    index 8ca0227..f2209a6 100644
    a b SubDir HAIKU_TOP src add-ons tracker filetype ;  
    33SetSubDirSupportedPlatformsBeOSCompatible ;
    44
    55# TODO: does not seem to work:
    6 AddResources FileType-F : FileType.rdef ;
     6AddResources FileType : FileType.rdef ;
    77
    8 Addon FileType-F :
     8Addon FileType :
    99    FileType.cpp
    1010
    1111    : be tracker
  • src/add-ons/tracker/mark_as/Jamfile

    diff --git a/src/add-ons/tracker/mark_as/Jamfile b/src/add-ons/tracker/mark_as/Jamfile
    index 0a22ea1..f8492aa 100644
    a b SetSubDirSupportedPlatformsBeOSCompatible ;  
    55UsePrivateHeaders mail ;
    66
    77AddResources Mark\ as… : MarkAs.rdef ;
    8 AddResources Mark\ as\ Read-R : MarkAsRead.rdef ;
     8AddResources Mark\ as\ Read : MarkAsRead.rdef ;
    99
    1010Addon Mark\ as… :
    1111    MarkAs.cpp
    1212    : be tracker $(TARGET_LIBSUPC++) libmail.so
    1313;
    1414
    15 Addon Mark\ as\ Read-R :
     15Addon Mark\ as\ Read :
    1616    MarkAsRead.cpp
    1717    : be tracker $(TARGET_LIBSUPC++) libmail.so
    1818;
  • src/add-ons/tracker/opentargetfolder/Jamfile

    diff --git a/src/add-ons/tracker/opentargetfolder/Jamfile b/src/add-ons/tracker/opentargetfolder/Jamfile
    index c44dfd8..0fcc931 100644
    a b  
    11SubDir HAIKU_TOP src add-ons tracker opentargetfolder ;
    22
    3 Application Open\ Target\ Folder-O :
     3Application Open\ Target\ Folder :
    44    opentargetfolder.cpp
    55
    66    : be tracker $(TARGET_LIBSUPC++)
  • src/add-ons/tracker/openterminal/Jamfile

    diff --git a/src/add-ons/tracker/openterminal/Jamfile b/src/add-ons/tracker/openterminal/Jamfile
    index 63f6c26..93a8d35 100644
    a b SubDir HAIKU_TOP src add-ons tracker openterminal ;  
    22
    33SetSubDirSupportedPlatformsBeOSCompatible ;
    44
    5 AddResources Open\ Terminal-T : OpenTerminal.rdef ;
     5AddResources Open\ Terminal : OpenTerminal.rdef ;
    66
    7 Addon Open\ Terminal-T :
     7Addon Open\ Terminal :
    88    OpenTerminal.cpp
    99
    1010    : be tracker $(TARGET_LIBSTDC++)
  • src/add-ons/tracker/zipomatic/Jamfile

    diff --git a/src/add-ons/tracker/zipomatic/Jamfile b/src/add-ons/tracker/zipomatic/Jamfile
    index f974e05..4c84ea6 100644
    a b SubDir HAIKU_TOP src add-ons tracker zipomatic ;  
    22
    33UsePrivateHeaders shared ;
    44
    5 Application ZipOMatic-Z :
     5Application ZipOMatic :
    66    GenericThread.cpp
    77    ZipOMatic.cpp
    88    ZipOMaticActivity.cpp
    Application ZipOMatic-Z :  
    1313    : ZipOMatic.rdef
    1414;
    1515
    16 DoCatalogs ZipOMatic-Z :
     16DoCatalogs ZipOMatic :
    1717    x-vnd.haiku.zip-o-matic
    1818    :
    1919    ZipOMatic.cpp
  • src/apps/diskusage/Jamfile

    diff --git a/src/apps/diskusage/Jamfile b/src/apps/diskusage/Jamfile
    index 37d3eff..b046505 100644
    a b DoCatalogs DiskUsage :  
    2828    StatusView.cpp
    2929    VolumeView.cpp
    3030;
    31 
  • src/kits/tracker/Attributes.h

    diff --git a/src/kits/tracker/Attributes.h b/src/kits/tracker/Attributes.h
    index b79f2eb..597a221 100644
    a b namespace BPrivate {  
    5151#define kAttrAppVersion                     "_trk/app_version"
    5252#define kAttrSystemVersion                  "_trk/system_version"
    5353#define kAttrOpenWithRelation               "_trk/open_with_relation"
     54#define kAttrShortcut                       "_trk/shortcut"
    5455
    5556// private attributes
    5657#define kAttrWindowFrame                    "_trk/windframe"
  • src/kits/tracker/ContainerWindow.cpp

    diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp
    index c2380b2..017f941 100644
    a b BContainerWindow::BContainerWindow(LockingList<BWindow>* list,  
    577577    fIsTrash(false),
    578578    fInTrash(false),
    579579    fIsPrinters(false),
     580    fIsAddons(false),
    580581    fContainerWindowFlags(containerWindowFlags),
    581582    fBackgroundImage(NULL),
    582583    fSavedZoomRect(0, 0, -1, -1),
    BContainerWindow::UpdateIfTrash(Model* model)  
    766767        fIsTrash = model->IsTrash();
    767768        fInTrash = FSInTrashDir(model->EntryRef());
    768769        fIsPrinters = FSIsPrintersDir(&entry);
     770        fIsAddons = FSIsAddonsDir(&entry);
    769771    }
    770772}
    771773
    BContainerWindow::EachAddon(BPath &path, bool (*eachAddon)(const Model*,  
    30113013            }
    30123014        }
    30133015
     3016        BNode node(model->EntryRef());
     3017        uint32 key = '\0';
    30143018        char name[B_FILE_NAME_LENGTH];
    3015         uint32 key;
    3016         StripShortcut(model, name, key);
     3019        if (node.ReadAttr(kAttrShortcut,
     3020                B_CHAR_TYPE, 0, &key, 1) > 0) {
     3021            strlcpy(name, model->Name(), B_FILE_NAME_LENGTH);
     3022        } else
     3023            StripShortcut(model, name, key);
    30173024
    30183025        // do a uniqueness check
    30193026        if (uniqueList->EachElement(MatchOne, name)) {
    BContainerWindow::NewAttributeMenu(BMenu* menu)  
    33543361            B_STRING_TYPE, 225, B_ALIGN_LEFT, false, false));
    33553362    }
    33563363
     3364    if (IsAddonsDir()) {
     3365        menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Shortcut"),
     3366            kAttrShortcut, B_CHAR_TYPE, 60, B_ALIGN_LEFT, true,
     3367            false));
     3368    }
     3369
    33573370#ifdef OWNER_GROUP_ATTRIBUTES
    33583371    menu->AddItem(NewAttributeMenuItem(B_TRANSLATE("Owner"), kAttrStatOwner,
    33593372        B_STRING_TYPE, 60, B_ALIGN_LEFT, false, true));
  • src/kits/tracker/ContainerWindow.h

    diff --git a/src/kits/tracker/ContainerWindow.h b/src/kits/tracker/ContainerWindow.h
    index 138d4f6..9ab4097 100644
    a b class BContainerWindow : public BWindow {  
    116116        bool IsTrash() const;
    117117        bool InTrash() const;
    118118        bool IsPrintersDir() const;
     119        bool IsAddonsDir() const;
    119120
    120121        virtual bool IsShowing(const node_ref*) const;
    121122        virtual bool IsShowing(const entry_ref*) const;
    class BContainerWindow : public BWindow {  
    287288        bool fIsTrash;
    288289        bool fInTrash;
    289290        bool fIsPrinters;
     291        bool fIsAddons;
    290292
    291293        uint32 fContainerWindowFlags;
    292294        BackgroundImage* fBackgroundImage;
    BContainerWindow::IsPrintersDir() const  
    390392    return fIsPrinters;
    391393}
    392394
     395inline bool
     396BContainerWindow::IsAddonsDir() const
     397{
     398    return fIsAddons;
     399}
     400
    393401inline void
    394402BContainerWindow::SetUpDiskMenu(BMenu*)
    395403{
  • src/kits/tracker/DeskWindow.cpp

    diff --git a/src/kits/tracker/DeskWindow.cpp b/src/kits/tracker/DeskWindow.cpp
    index b8ea334..1694505 100644
    a b AddOneShortcut(const Model* model, const char*, uint32 shortcut,  
    9696    BMessage* runAddon = new BMessage(kLoadAddOn);
    9797    runAddon->AddRef("refs", model->EntryRef());
    9898
     99    TTracker::WatchNode(model->NodeRef(), B_WATCH_ATTR, params->window);
    99100    params->window->AddShortcut(shortcut, B_OPTION_KEY | B_COMMAND_KEY,
    100101        runAddon);
    101102    params->currentAddonShortcuts->insert(shortcut);
  • src/kits/tracker/FSUtils.cpp

    diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
    index 8a75bbc..eb09fe8 100644
    a b FSIsRootDir(const BEntry* entry)  
    26572657
    26582658
    26592659bool
     2660FSIsAddonsDir(const BEntry* entry)
     2661{
     2662    BEntry parent;
     2663    char name[B_FILE_NAME_LENGTH];
     2664    if (entry->GetName(name) != B_OK || entry->GetParent(&parent) != B_OK)
     2665        return false;
     2666    return strcmp(name, "Tracker") == 0
     2667        && (FSIsDirFlavor(&parent, B_SYSTEM_ADDONS_DIRECTORY)
     2668            || FSIsDirFlavor(&parent, B_COMMON_ADDONS_DIRECTORY)
     2669            || FSIsDirFlavor(&parent, B_USER_ADDONS_DIRECTORY));
     2670}
     2671
     2672
     2673bool
    26602674DirectoryMatchesOrContains(const BEntry* entry, directory_which which)
    26612675{
    26622676    BPath path;
  • src/kits/tracker/FSUtils.h

    diff --git a/src/kits/tracker/FSUtils.h b/src/kits/tracker/FSUtils.h
    index d872cfc..d6be989 100644
    a b _IMPEXP_TRACKER bool FSIsPrintersDir(const BEntry*);  
    176176_IMPEXP_TRACKER bool FSIsDeskDir(const BEntry*);
    177177_IMPEXP_TRACKER bool FSIsHomeDir(const BEntry*);
    178178_IMPEXP_TRACKER bool FSIsRootDir(const BEntry*);
     179_IMPEXP_TRACKER bool FSIsAddonsDir(const BEntry*);
    179180_IMPEXP_TRACKER void FSMoveToTrash(BObjectList<entry_ref>* srcList,
    180181    BList* pointList = NULL, bool async = true);
    181182    // Deprecated