did you notice that if you use FindWildbyPath to scan "c:\" and a file is found in dir c:\, for istance c:\hello.mp3, that file is found in each directory scanned?
I tested this behaviour both on emulator and on device (N6630, N6600).
Everythings ok (file found exactly ONE time) if the file is in the root of MMC (for example: e:\hello.mp3).
Fabriz
I often regret my speech, I never regret my silence
for( TInt i = 0; i < aFiles->Count(); i++ ) { TBuf<256> item; item.Format(_L("%S"), &(aFiles->At(i)) ); itemTextArray->AppendL(item);
}
dlg->RunLD()
// Load cba, menu, etc as necessary iAppView->SetCommandSetL(R_SOFTKEYS); //iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_MENUBAR); } // // files are now in "aFiles"
I use this code snippet without any problem...probably your resource in rss does not fit with CAknListQueryDialog. For this reason I attach the resource I use:
I got it.how to show only manes & not the full path. Just a small change Instead of aArray->AppendL(parse.FullName()); Use aArray->AppendL(parse.Name());
Hi, After displaying the list. i want to select the file ..using enter key ok..but i am not getting the handellistbox event or key response so that can use the selected file for further processing. one function currentfilename() that will return the selected file
Forum posts: 1379
didster
Forum posts: 45
Hi,
But the TFindFile helps us to search only files in a particular directory and not in the sub directories.
Forum posts: 1379
{
CDirScan* scan = CDirScan::NewLC(aFs);
scan->SetScanDataL(aPath, KEntryAttDir|KEntryAttMatchExclusive, ESortNone, CDirScan::EScanDownTree);
FOREVER
{
CDir* dir = NULL;
TRAPD(error, scan->NextL(dir));
if (error || !dir)
break;
delete dir;
ScanDirL(aFs, scan->FullPath(), aWild, aArray);
};
CleanupStack::PopAndDestroy(scan);
}
void ScanDirL(RFs& aFs, const TDesC& aDir, const TDesC& aWild, CDesCArray* aArray)
{
TParse parse;
parse.Set(aWild, &aDir, NULL);
TPtrC spec(parse.FullName());
TFindFile find(aFs);
CDir* dir;
if (!find.FindWildByPath(parse.FullName(), NULL, dir))
{
CleanupStack::PushL(dir);
for(int i = 0; i < dir->Count(); i++)
{
parse.Set((*dir)[i].iName, &spec, NULL);
aArray->AppendL(parse.FullName());
}
CleanupStack::PopAndDestroy(dir);
}
}
Then, to say find all the mp3s in "C:\T" its sub dirs, do this:
RFs aFs;
aFs.Connect();
CleanupClosePushL(aFs);
CDesCArrayFlat* aFiles = new (ELeave) CDesCArrayFlat(4);
CleanupStack::PushL(aFiles)
ScanStartL(aFs, _L("C:\\T\\"), _L("*.mp3"), aFiles);
//
// files are now in "aFiles"
CleanupStack::PopAndDestory(aFiles);
CleanupStack::PopAndDestory(&aFs);
In that code, aFiles will have "C:\\T\\a.mp3", ":C:\\T\\B\\b.mp3" or what ever in.
didster
Forum posts: 45
Thanks a lot
Regards,
Prabhu.
Forum posts: 3
I think that you could check RApaLsSession for getting installed applications.
There is a similiar thread on the Board
Best regards
SW Team
Best regards
SymbWorks
Forum posts: 35
did you notice that if you use FindWildbyPath to scan "c:\" and a file is found in dir c:\, for istance c:\hello.mp3, that file is found in each directory scanned?
I tested this behaviour both on emulator and on device (N6630, N6600).
Everythings ok (file found exactly ONE time) if the file is in the root of MMC (for example: e:\hello.mp3).
Fabriz
I often regret my speech, I never regret my silence
Forum posts: 35
The dialog listbox is not the same but I don't think it's a big issue modify it.
void CMyAppUi::display()
{
RFs aFs;
aFs.Connect();
CleanupClosePushL(aFs);
CDesCArrayFlat* aFiles = new (ELeave) CDesCArrayFlat(4);
CleanupStack::PushL(aFiles);
ScanStartL(aFs, _L("c:\\clips\\"), _L("*.mp3"), aFiles);
TInt index;
// CAknSelectionListDialog* dialog = CAknSelectionListDialog::NewL(index, aFiles, 0);
CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &index );
dlg->PrepareLC(R_LIST_DIALOG);
CDesCArray *itemTextArray = new (ELeave) CDesCArrayFlat(1);
dlg->SetItemTextArray(itemTextArray);
for( TInt i = 0; i < aFiles->Count(); i++ )
{
TBuf<256> item;
item.Format(_L("%S"), &(aFiles->At(i)) );
itemTextArray->AppendL(item);
}
dlg->RunLD()
// Load cba, menu, etc as necessary
iAppView->SetCommandSetL(R_SOFTKEYS);
//iEikonEnv->AppUiFactory()->MenuBar()->SetMenuTitleResourceId(R_MENUBAR);
}
//
// files are now in "aFiles"
CleanupStack::PopAndDestroy(aFiles);
CleanupStack::PopAndDestroy(&aFs);
}
I often regret my speech, I never regret my silence
Forum posts: 35
item.Format(_L("%S"), &( (*aFiles)[i] ) );
instead of
item.Format(_L("%S"), &(aFiles->At(i)) );
I often regret my speech, I never regret my silence
Forum posts: 35
I use this code snippet without any problem...probably your resource in rss does not fit with CAknListQueryDialog.
For this reason I attach the resource I use:
RESOURCE DIALOG r_list_query
{
flags = EGeneralQueryFlags;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtListQueryControl;
id = EListQueryControl;
control = AVKON_LIST_QUERY_CONTROL
{
listtype = EAknCtSinglePopupMenuListBox;
listbox = LISTBOX
{
flags = EAknListBoxMenuList;
height = 3;
width = 10;
array_id = r_demo_list_query_item;
};
heading = qtn_akntanote_select_playlist;
};
}
};
}
RESOURCE ARRAY r_demo_list_query_item
{
items =
{
LBUF {txt = "First item"; },
LBUF {txt = "Second item"; },
LBUF {txt = "Third item"; }
};
}
I hope this is the right suggestion
Fabriz
I often regret my speech, I never regret my silence
Forum posts: 35
I often regret my speech, I never regret my silence
Forum posts: 13
If u have any sample program for this ,Can u please forward to me
Regards,
Meghana
Forum posts: 13
I got it.how to show only manes & not the full path.
Just a small change
Instead of
aArray->AppendL(parse.FullName());
Use
aArray->AppendL(parse.Name());
Thanks a lot for ur help.
Regards,
Meghana
Forum posts: 13
After displaying the list. i want to select the file ..using enter key ok..but i am not getting the handellistbox event or key response so that can use the selected file for further processing.
one function currentfilename() that will return the selected file
Regards,
Meghana
Forum posts: 13
I am not able to select the file from the displayed list.
Please Help
Regards,
Meghana