Changeset 183 for trunk/desktop/src


Ignore:
Timestamp:
Jan 7, 2007, 10:36:52 PM (19 years ago)
Author:
cinc
Message:

New methods and additions all over the place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/src/vdesktop.c

    r166 r183  
    3838#define INCL_DOSERRORS
    3939#define INCL_PM
     40
    4041#include <os2.h>
    4142#include <stdio.h>
    4243#include <stdlib.h>
    4344#include <string.h>
     45
    4446#include <gtk/gtk.h>
    4547#include "debug_window.h"
     
    5052#include "nomgc.h"
    5153#include "nomguitk.h"
     54#include "nomwindow.h"
     55#include "desktoptypes.h"
     56
    5257#include "nomfolderwindow.h"
    5358#include "wpobject.h"
    5459#include "wpfolder.h"
    55 #include "desktoptypes.h"
     60#include "nomfilepath.h"
     61
    5662
    5763int createQuitWindow(void);
     
    6874  return FALSE;
    6975}
     76
     77WPFolder* wpRootFolder;
    7078
    7179/*
     
    8593  /* Desktop folder */
    8694  WPFolder *wpDesktop;
    87  
     95  WPFolder *wpTempFolder;
     96  PNOMPath nomPath; 
     97  PNOMPath np;
     98
    8899  hReg=nomBeginRegisterDLLWithGC();
    89100  if(NULLHANDLE==hReg)
     
    117128  /* Query current dir */
    118129  g_strlcpy(desktopDir, g_get_current_dir(), sizeof(desktopDir));
    119   dbgPrintf("Desktop: %s", desktopDir);
     130  g_message("Desktop: %s", desktopDir);
    120131
    121132  /*
     
    133144  NOMClassMgrObject=nomEnvironmentNew();
    134145  //dbgPrintf( "NOMClassMgrObject: %x", NOMClassMgrObject);
    135  
     146
     147  nomPath=NOMPathNew();
     148  NOMPath_assignCString(nomPath, desktopDir, NULLHANDLE);
     149  /* Make sure there's no '/' at the end */
     150  nomPath=NOMPath_stripSeparator(nomPath, NULLHANDLE);
     151
     152  /* Create root folder */
     153  wpRootFolder=WPFolderNew();
     154  WPFolder_tstSetFullPath(wpRootFolder, NOMPath_queryCString(NOMPath_queryRoot(nomPath, NULLHANDLE),NULLHANDLE),
     155                          NULLHANDLE);
     156  wpTempFolder=wpRootFolder;
     157
     158  nomPath=NOMPath_erasePathBegin(nomPath, NULLHANDLE);
     159
     160  /* Now create all folders up the chain */
     161  while(NOMPath_length(nomPath, NULLHANDLE)>0)
     162    {
     163      NOMPath* np;
     164      WPFolder* wpFolder;
     165      np=NOMPath_queryPathBegin(nomPath, NULLHANDLE);
     166
     167      wpFolder=WPFolderNew();
     168      WPFolder_tstSetFullPath(wpFolder, NOMPath_queryCString(np,NULLHANDLE),
     169                              NULLHANDLE);
     170      WPFolder_wpSetFolder(wpFolder, wpTempFolder, NULLHANDLE);
     171      wpTempFolder=wpFolder;
     172      nomPath=NOMPath_erasePathBegin(nomPath, NULLHANDLE);
     173      WPFolder_wpQueryFileName(wpFolder, TRUE, NULLHANDLE);
     174      //g_message("   path: %s", NOMPath_queryCString(WPFolder_wpQueryFileName(wpFolder, TRUE, NULLHANDLE),
     175      //                                            NULLHANDLE));
     176    };
     177
     178  g_message("   --> Desktop dir: %s", NOMPath_queryCString(WPFolder_wpQueryFileName(wpTempFolder, TRUE, NULLHANDLE),
     179                                                            NULLHANDLE));
     180
    136181  /* Create desktop folder */
    137   wpDesktop=WPFolderNew();
    138 
    139   dbgPrintf( "Created desktop object: %x", wpDesktop);
    140   WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE);
    141  
     182  wpDesktop=wpTempFolder;//WPFolderNew();
     183
     184  //WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE);
     185  //WPFolder_tstSetFullPath(wpDesktop, "r:", NULLHANDLE);
    142186  WPFolder_wpOpen(wpDesktop, NULL, OPEN_DEFAULT,  NULL, NULL);
    143187  /*    WPFolder_wpPopulate(wpObject, 0,"blabla 2", 0,  NULL);  */
Note: See TracChangeset for help on using the changeset viewer.