Changeset 4808ce64


Ignore:
Timestamp:
12/10/13 08:41:16 (12 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
0769839
Parents:
d4237445
Message:

Add the external-links support to the PBIModule class. Looks like the new backend is ready to start being implemented into the GUI now.

Location:
src-qt4/EasyPBI-devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI-devel/Makefile

    r69ec30c r4808ce64  
    11############################################################################# 
    22# Makefile for building: EasyPBI 
    3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Dec 10 10:59:18 2013 
     3# Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Dec 10 11:34:10 2013 
    44# Project:  EasyPBI.pro 
    55# Template: app 
     
    5757                moc_preferencesDialog.cpp \ 
    5858                moc_aboutDialog.cpp \ 
    59                 moc_PBIModule.cpp \ 
    6059                qrc_EasyPBI.cpp 
    6160OBJECTS       = main.o \ 
     
    7372                moc_preferencesDialog.o \ 
    7473                moc_aboutDialog.o \ 
    75                 moc_PBIModule.o \ 
    7674                qrc_EasyPBI.o 
    7775DIST          = /usr/local/share/qt4/mkspecs/common/unix.conf \ 
     
    215213mocables: compiler_moc_header_make_all compiler_moc_source_make_all 
    216214 
    217 compiler_moc_header_make_all: moc_mainGUI.cpp moc_newModuleDialog.cpp moc_preferencesDialog.cpp moc_aboutDialog.cpp moc_PBIModule.cpp 
     215compiler_moc_header_make_all: moc_mainGUI.cpp moc_newModuleDialog.cpp moc_preferencesDialog.cpp moc_aboutDialog.cpp 
    218216compiler_moc_header_clean: 
    219         -$(DEL_FILE) moc_mainGUI.cpp moc_newModuleDialog.cpp moc_preferencesDialog.cpp moc_aboutDialog.cpp moc_PBIModule.cpp 
     217        -$(DEL_FILE) moc_mainGUI.cpp moc_newModuleDialog.cpp moc_preferencesDialog.cpp moc_aboutDialog.cpp 
    220218moc_mainGUI.cpp: modBuild.h \ 
    221219                backend.h \ 
     
    238236                aboutDialog.h 
    239237        /usr/local/bin/moc-qt4 $(DEFINES) $(INCPATH) aboutDialog.h -o moc_aboutDialog.cpp 
    240  
    241 moc_PBIModule.cpp: PBIModule.h 
    242         /usr/local/bin/moc-qt4 $(DEFINES) $(INCPATH) PBIModule.h -o moc_PBIModule.cpp 
    243238 
    244239compiler_rcc_make_all: qrc_EasyPBI.cpp 
     
    350345        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_aboutDialog.o moc_aboutDialog.cpp 
    351346 
    352 moc_PBIModule.o: moc_PBIModule.cpp  
    353         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_PBIModule.o moc_PBIModule.cpp 
    354  
    355347qrc_EasyPBI.o: qrc_EasyPBI.cpp  
    356348        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_EasyPBI.o qrc_EasyPBI.cpp 
  • src-qt4/EasyPBI-devel/PBIModule.cpp

    r69ec30c r4808ce64  
    537537//  EXTERNAL-LINKS 
    538538// ============= 
     539void PBIModule::loadExternalLinks( QStringList& bin, QStringList& link, QStringList& type){ 
     540  //Empty the output variables 
     541  bin.clear(); 
     542  link.clear(); 
     543  type.clear(); 
     544  //Read the file and parse the contents 
     545  QStringList contents = readFile(basePath+"/external-links"); 
     546  for(int i=0; i<contents.length(); i++){ 
     547    contents[i] = contents[i].replace("\t"," ").simplified(); 
     548    if(!contents[i].startsWith("#") && !contents[i].isEmpty()){ 
     549      bin << contents[i].section(" ",0,0,QString::SectionSkipEmpty); 
     550      link <<  contents[i].section(" ",1,1,QString::SectionSkipEmpty); 
     551      type <<  contents[i].section(" ",2,2,QString::SectionSkipEmpty); 
     552    } 
     553  } 
     554 
     555} 
     556 
     557bool PBIModule::saveExternalLinks( QStringList bin, QStringList link, QStringList type){ 
     558  if( (bin.length() != link.length()) || (bin.length() != type.length()) ){ 
     559    qDebug() << "Error: Unequal external-links list lengths"; 
     560    return false; 
     561  } 
     562  //Create the file contents 
     563  QStringList contents; 
     564  contents << "# Files to be Sym-Linked into the default LOCALBASE"; 
     565  contents << "# One per-line, relative to %%PBI_APPDIR%% and LOCALBASE"; 
     566  contents << "# Defaults to keeping any existing files in LOCALBASE"; 
     567  contents << "# Use action \"binary\" for binaries that need wrapper functionality\n"; 
     568  contents << "# TARGET             LINK IN LOCALBASE         ACTION"; 
     569  for(int i=0; i<bin.length(); i++){ 
     570    contents << bin[i] + " \t " + link[i] + " \t " + type[i]; 
     571  } 
     572  //Now save the contents to file 
     573  return createFile(basePath+"/external-links", contents); 
     574   
     575} 
    539576 
    540577// =============== 
  • src-qt4/EasyPBI-devel/PBIModule.h

    r69ec30c r4808ce64  
    8383         
    8484        //External Links 
     85        void loadExternalLinks( QStringList& bin, QStringList& link, QStringList& type); 
     86        bool saveExternalLinks( QStringList bin, QStringList link, QStringList type); 
    8587 
    8688        //General Utilities 
     
    9799        QString basePath, version; 
    98100 
    99 signals: 
    100  
    101101}; 
    102102 
Note: See TracChangeset for help on using the changeset viewer.