summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp
index e53124f..5aaf66e 100644
--- a/pwmanager/pwmanager/pwmview.cpp
+++ b/pwmanager/pwmanager/pwmview.cpp
@@ -232,48 +232,49 @@ void PwMView::shiftToView()
232 232
233 unsigned int catDocIndex; 233 unsigned int catDocIndex;
234 if (unlikely( 234 if (unlikely(
235 !(document()->findCategory(getCurrentCategory(), 235 !(document()->findCategory(getCurrentCategory(),
236 &catDocIndex)))) { 236 &catDocIndex)))) {
237 BUG(); 237 BUG();
238 } 238 }
239 239
240 // ensure all listViewPos are set 240 // ensure all listViewPos are set
241 doc->ensureLvp(); 241 doc->ensureLvp();
242 242
243 // clear all tmp-data vectors 243 // clear all tmp-data vectors
244 unsigned int i, entries = doc->numEntries(catDocIndex); 244 unsigned int i, entries = doc->numEntries(catDocIndex);
245 if (entries) { 245 if (entries) {
246 mainClass->setVirgin(false); 246 mainClass->setVirgin(false);
247 } 247 }
248 vector<PwMDataItem> tmpSorted; 248 vector<PwMDataItem> tmpSorted;
249 PwMDataItem currItem; 249 PwMDataItem currItem;
250 currItem.clear(); 250 currItem.clear();
251 tmpSorted.insert(tmpSorted.begin(), entries, currItem); 251 tmpSorted.insert(tmpSorted.begin(), entries, currItem);
252 252
253 // Sort items and store them in tempoary tmpSorted. 253 // Sort items and store them in tempoary tmpSorted.
254 for (i = 0; i < entries; ++i) { 254 for (i = 0; i < entries; ++i) {
255 doc->getEntry(catDocIndex, i, &currItem); 255 doc->getEntry(catDocIndex, i, &currItem);
256 //qDebug("PwMView::shiftToView: %s, %i", currItem.desc.c_str(), currItem.listViewPos);
256 tmpSorted[currItem.listViewPos] = currItem; 257 tmpSorted[currItem.listViewPos] = currItem;
257 } 258 }
258 259
259 // shift tempoary data to ListView. 260 // shift tempoary data to ListView.
260 tmpDisableSort(); 261 tmpDisableSort();
261 lv->clear(); 262 lv->clear();
262 QCheckListItem *newItem; 263 QCheckListItem *newItem;
263 vector<PwMDataItem>::iterator it = tmpSorted.begin(), 264 vector<PwMDataItem>::iterator it = tmpSorted.begin(),
264 end = tmpSorted.end(); 265 end = tmpSorted.end();
265 while (it != end) { 266 while (it != end) {
266 newItem = new ListViewItemPwM(lv); 267 newItem = new ListViewItemPwM(lv);
267 newItem->setText(COLUMN_DESC, (*it).desc.c_str()); 268 newItem->setText(COLUMN_DESC, (*it).desc.c_str());
268 if ((*it).binary) { 269 if ((*it).binary) {
269 newItem->setText(COLUMN_NAME, ""); 270 newItem->setText(COLUMN_NAME, "");
270 newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>")); 271 newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>"));
271 newItem->setText(COLUMN_URL, ""); 272 newItem->setText(COLUMN_URL, "");
272 newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); 273 newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str());
273 } else { 274 } else {
274 newItem->setText(COLUMN_NAME, (*it).name.c_str()); 275 newItem->setText(COLUMN_NAME, (*it).name.c_str());
275 if ((*it).lockStat) { 276 if ((*it).lockStat) {
276 newItem->setText(COLUMN_PW, QString((*it).pw.c_str()) 277 newItem->setText(COLUMN_PW, QString((*it).pw.c_str())
277 + " " 278 + " "
278 + i18n("To unlock click the icon on the left.")); 279 + i18n("To unlock click the icon on the left."));
279 } else { 280 } else {
@@ -471,48 +472,52 @@ PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name )
471//US setWrapPolicy( QTextEdit::AtWordBoundary ); 472//US setWrapPolicy( QTextEdit::AtWordBoundary );
472 setLinkUnderline( false ); 473 setLinkUnderline( false );
473 // setVScrollBarMode( QScrollView::AlwaysOff ); 474 // setVScrollBarMode( QScrollView::AlwaysOff );
474 //setHScrollBarMode( QScrollView::AlwaysOff ); 475 //setHScrollBarMode( QScrollView::AlwaysOff );
475 476
476//US QStyleSheet *sheet = styleSheet(); 477//US QStyleSheet *sheet = styleSheet();
477//US QStyleSheetItem *link = sheet->item( "a" ); 478//US QStyleSheetItem *link = sheet->item( "a" );
478//US link->setColor( KGlobalSettings::linkColor() ); 479//US link->setColor( KGlobalSettings::linkColor() );
479 480
480} 481}
481 482
482void PwMDataItemView::setPwMDataItem( const PwMDataItem& a ) 483void PwMDataItemView::setPwMDataItem( const PwMDataItem& a )
483 484
484{ 485{
485 mItem = a; 486 mItem = a;
486 // clear view 487 // clear view
487 setText( QString::null ); 488 setText( QString::null );
488 489
489 490
490 QString dynamicPart; 491 QString dynamicPart;
491 QString format = "<tr><td align=\"right\"><b>%1</b></td>" 492 QString format = "<tr><td align=\"right\"><b>%1</b></td>"
492 "<td align=\"left\">%2</td></tr>"; 493 "<td align=\"left\">%2</td></tr>";
493 494
494 dynamicPart += format 495 dynamicPart += format
496 .arg( i18n("LastUpdate") )
497 .arg( mItem.meta.update.toString().latin1() );
498
499 dynamicPart += format
495 .arg( i18n("Description") ) 500 .arg( i18n("Description") )
496 .arg( mItem.desc.c_str() ); 501 .arg( mItem.desc.c_str() );
497 502
498 dynamicPart += format 503 dynamicPart += format
499 .arg( i18n("Name") ) 504 .arg( i18n("Name") )
500 .arg( mItem.name.c_str() ); 505 .arg( mItem.name.c_str() );
501 506
502 dynamicPart += format 507 dynamicPart += format
503 .arg( i18n("Password") ) 508 .arg( i18n("Password") )
504 .arg( mItem.pw.c_str() ); 509 .arg( mItem.pw.c_str() );
505 510
506 QString comment(mItem.pw.c_str()); 511 QString comment(mItem.pw.c_str());
507 dynamicPart += format 512 dynamicPart += format
508 .arg( i18n("Comment") ) 513 .arg( i18n("Comment") )
509 .arg( comment.replace( QRegExp("\n"), "<br>" ) ); 514 .arg( comment.replace( QRegExp("\n"), "<br>" ) );
510 515
511 dynamicPart += format 516 dynamicPart += format
512 .arg( i18n("URL") ) 517 .arg( i18n("URL") )
513 .arg( mItem.url.c_str() ); 518 .arg( mItem.url.c_str() );
514 519
515 dynamicPart += format 520 dynamicPart += format
516 .arg( i18n("Launcher") ) 521 .arg( i18n("Launcher") )
517 .arg( mItem.launcher.c_str() ); 522 .arg( mItem.launcher.c_str() );
518 523