Author: gs
Date: Wed Nov 14 11:56:24 2007
New Revision: 42037
URL: http://svn.opensuse.org/viewcvs/yast?rev=42037&view=rev
Log:
replace YCPValue result; by string result; in NCursesEvent
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Wed Nov 14 11:56:24 2007
@@ -240,7 +240,7 @@
{
if ( currentId->toString() == idOk )
{
- postevent.result = YCPString( dirList->getCurrentDir() );
+ postevent.result = dirList->getCurrentDir();
// return false means: close the popup
return false;
}
@@ -248,7 +248,7 @@
{
unsigned int i = dirName->getListSize();
- if (postevent.result.isNull ())
+ if ( postevent.result == "" )
return true;
// FIXME ??? - what about 'i'
@@ -258,8 +258,8 @@
true );
#endif
// show the currently selected directory
- NCMIL << "Add item: " << postevent.result->asString()->value() << endl;
- dirName->addItem( postevent.result->asString()->value(),
+ NCMIL << "Add item: " << postevent.result << endl;
+ dirName->addItem( postevent.result,
true );
if ( postevent.reason == YEvent::Activated )
@@ -288,14 +288,14 @@
}
else
{
- postevent.result = YCPNull();
+ postevent.result = "";
return false;
}
}
if (postevent == NCursesEvent::cancel)
{
- postevent.result = YCPNull();
+ postevent.result = "";
return false;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForFile.cc Wed Nov 14 11:56:24 2007
@@ -349,13 +349,12 @@
{
if ( currentId->toString() == idOk )
{
- postevent.result = YCPString( dirList->getCurrentDir() + "/"
- + getFileName() );
+ postevent.result = dirList->getCurrentDir() + "/" + getFileName();
// return false means: close the popup
return false;
}
- else if ( currentId->toString() == idDirList
- && !postevent.result.isNull() )
+ else if ( ( currentId->toString() == idDirList ) &&
+ ( postevent.result != "" ) )
{
unsigned int i = dirName->getListSize();
#if 0
@@ -365,7 +364,7 @@
#endif
//FIXME ??? - what about 'i'
// show the currently selected directory
- dirName->addItem( postevent.result->asString()->value(),
+ dirName->addItem( postevent.result,
true );
updateFileList();
@@ -401,22 +400,22 @@
}
else if ( currentId->toString() == idFileList )
{
- if ( !postevent.result.isNull() )
+ if ( postevent.result != "" )
{
// FIXME - check this !!!
- fileName->setValue( postevent.result->asString()->value() );
+ fileName->setValue( postevent.result );
}
}
else
{
- postevent.result = YCPNull();
+ postevent.result = "";
return false;
}
}
if (postevent == NCursesEvent::cancel)
{
- postevent.result = YCPNull();
+ postevent.result = "";
return false;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc Wed Nov 14 11:56:24 2007
@@ -311,8 +311,8 @@
Items[0] = new NCFileSelectionTag( info );
for ( unsigned i = 1; i < elements.size()+1; ++i ) {
- // use YCPString to enforce recoding from 'utf8'
- Items[i] = new NCTableCol( YCPString( elements[i-1] ), NCTableCol::PLAIN );
+ // use NCstring to enforce recoding from 'utf8'
+ Items[i] = new NCTableCol( NCstring( elements[i-1] ), NCTableCol::PLAIN );
}
myPad()->Append( Items );
}
@@ -611,7 +611,7 @@
case KEY_NPAGE:
case KEY_END: {
ret = NCursesEvent::SelectionChanged;
- ret.result = YCPString( currentFile );
+ ret.result = currentFile;
break;
}
default:
@@ -874,7 +874,7 @@
{
setCurrentDir();
ret = NCursesEvent::SelectionChanged;
- ret.result = YCPString( currentDir );
+ ret.result = currentDir;
}
break;
}
@@ -883,14 +883,14 @@
case KEY_END: {
setCurrentDir();
ret = NCursesEvent::SelectionChanged;
- ret.result = YCPString( currentDir );
+ ret.result = currentDir;
break;
}
case KEY_RETURN:
case KEY_SPACE: {
setCurrentDir();
ret = NCursesEvent::Activated;
- ret.result = YCPString( currentDir );
+ ret.result = currentDir;
break;
}
default:
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc Wed Nov 14 11:56:24 2007
@@ -55,7 +55,7 @@
// tree and creates the NCPackageSelector.
//
YPackageSelector * NCPackageSelectorPlugin::createPackageSelector( YWidget * parent,
- long modeFlags )
+ long modeFlags )
{
YWidget * w = 0;
try
@@ -185,10 +185,12 @@
YDialog::deleteTopmostDialog();
- if ( !event.result.isNull() )
+ if ( event.result != "" )
{
- UIMIL << "Return value: " << event.result->toString() << endl;
- return event.result;
+ NCMIL << "Return value: " << event.result << endl;
+
+ YCPTerm id( event.result );
+ return YCPSymbol( id->name() );
}
else
return YCPVoid();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCurses.h?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCurses.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCurses.h Wed Nov 14 11:56:24 2007
@@ -89,9 +89,8 @@
Type type;
NCWidget * widget;
YMenuItem * selection; // used for MenuEvent (the menu selection)
- //YCPValue selection;
- YCPValue result; // can be used for any result
+ string result; // can be used for any (string) result
string keySymbol; // used for KeyEvent (symbol pressed key)
@@ -103,7 +102,7 @@
: type ( t )
, widget ( 0 )
, selection( 0 )
- , result ( YCPNull() )
+ , result ( "" )
, detail ( NODETAIL )
, reason ( r )
{}
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Wed Nov 14 11:56:24 2007
@@ -694,10 +694,10 @@
NCursesEvent retEvent = filePopup->showDirPopup( );
YDialog::deleteTopmostDialog();
- if ( !retEvent.result.isNull() )
+ if ( retEvent.result != "" )
{
- NCMIL << "Returning: " << retEvent.result->toString() << endl;
- return retEvent.result;
+ NCMIL << "Returning: " << retEvent.result << endl;
+ return YCPString( retEvent.result );
}
else
return YCPVoid(); // nothing selected -> return 'nil'
@@ -721,10 +721,10 @@
NCursesEvent retEvent = filePopup->showDirPopup( );
YDialog::deleteTopmostDialog();
- if ( !retEvent.result.isNull() )
+ if ( retEvent.result != "" )
{
- NCMIL << "Returning: " << retEvent.result->toString() << endl;
- return retEvent.result;
+ NCMIL << "Returning: " << retEvent.result << endl;
+ return YCPString( retEvent.result );
}
else
return YCPVoid(); // nothing selected -> return 'nil'
@@ -747,10 +747,10 @@
NCursesEvent retEvent = dirPopup->showDirPopup( );
YDialog::deleteTopmostDialog();
- if ( !retEvent.result.isNull() )
+ if ( retEvent.result != "" )
{
- NCMIL << "Returning: " << retEvent.result->toString() << endl;
- return retEvent.result;
+ NCMIL << "Returning: " << retEvent.result << endl;
+ return YCPString( retEvent.result );
}
else
return YCPVoid(); // nothing selected -> return 'nil'
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc?rev=42037&r1=42036&r2=42037&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Wed Nov 14 11:56:24 2007
@@ -691,18 +691,17 @@
//
// Fills the package table
//
-bool NCPackageSelector::fillSearchList( const YCPString & expr,
- bool ignoreCase,
- bool checkName,
- bool checkSummary,
- bool checkDescr,
- bool checkProvides,
- bool checkRequires )
+bool NCPackageSelector::fillSearchList( const string & expr,
+ bool ignoreCase,
+ bool checkName,
+ bool checkSummary,
+ bool checkDescr,
+ bool checkProvides,
+ bool checkRequires )
{
NCPkgTable * packageList = getPackageList();
- if ( !packageList
- || expr.isNull() )
+ if ( !packageList )
{
return false;
}
@@ -750,11 +749,11 @@
zypp::CapSet value = pkg->dep (zypp::Dep::REQUIRES);
requires = createRelLine( value );
}
- if ( ( checkName && match( pkg->name(), expr->value(), ignoreCase )) ||
- ( checkSummary && match( pkg->summary(), expr->value(), ignoreCase) ) ||
- ( checkDescr && match( description, expr->value(), ignoreCase) ) ||
- ( checkProvides && match( provides, expr->value(), ignoreCase) ) ||
- ( checkRequires && match( requires, expr->value(), ignoreCase) )
+ if ( ( checkName && match( pkg->name(), expr, ignoreCase )) ||
+ ( checkSummary && match( pkg->summary(), expr, ignoreCase) ) ||
+ ( checkDescr && match( description, expr, ignoreCase) ) ||
+ ( checkProvides && match( provides, expr, ignoreCase) ) ||
+ ( checkRequires && match( requires, expr, ignoreCase) )
)
{
// search sucessful
@@ -785,12 +784,11 @@
//
// Fills the patch list with search results
//
-bool NCPackageSelector::fillPatchSearchList( const YCPString & expr )
+bool NCPackageSelector::fillPatchSearchList( const string & expr )
{
NCPkgTable * packageList = getPackageList();
- if ( !packageList
- || expr.isNull() )
+ if ( !packageList )
{
return false;
}
@@ -808,7 +806,7 @@
if ( patchPtr )
{
- if ( match( (*listIt)->name(), expr->value(), true ) )
+ if ( match( (*listIt)->name(), expr, true ) )
{
// search sucessful
packageList->createPatchEntry( patchPtr, *listIt );
@@ -1467,7 +1465,7 @@
if ( retEvent == NCursesEvent::button )
{
- NCMIL << "Searching for: " << (!retEvent.result.isNull()?retEvent.result->toString():"") << endl;
+ NCMIL << "Searching for: " << retEvent.result << endl;
packageList->showInformation( );
}
else
@@ -2377,7 +2375,7 @@
restoreState ();
NCMIL << "Cancel button pressed - leaving package selection" << endl;
- const_cast