[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/utils/gwenrename/src
From: Spiros Georgaras <sngeorgaras () otenet ! gr>
Date: 2009-07-09 22:33:46
Message-ID: 1247178826.990676.24812.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 994026 by sngeorgaras:
trying to fix translatable,wired html ui code
M +0 -15 dirsdata.cpp
M +8 -7 exif.cpp
M +0 -2 iconload.cpp
M +0 -7 initaskmode.ui
M +0 -2 inputdir.cpp
M +3 -16 main.cpp
M +2 -0 namepartbase.cpp
M +2 -6 namepartbase.ui
M +5 -9 rename.ui
M +3 -1 timestamp.cpp
M +2 -1 timestamp.h
M +1 -1 timestamp.ui
--- trunk/playground/utils/gwenrename/src/dirsdata.cpp #994025:994026
@@ -26,8 +26,6 @@
dirsData::dirsData(){
hasBeenSorted=false;
sortID=false;
- // deleted by Krazy2
- // mPath=QString::null;
mPath.clear();
mFilter=-1;
}
@@ -139,11 +137,7 @@
// qWarning("dirsData::setLink() - b->getType() = %d",b->getType());
if(b->getType()==2)
if(!ren[k].oldExtension.isEmpty()){
- // deleted by Krazy2
- // ren[k].oldName=ren[k].oldName+"."+ren[k].oldExtension;
ren[k].oldName=ren[k].oldName+'.'+ren[k].oldExtension;
- // deleted by Krazy2
- // ren[k].oldExtension=QString::null;
ren[k].oldExtension.clear();
}
// qWarning("dirsData::setLink() - fixed ren[k].oldExtension = \
%s",ren[k].oldExtension.toLocal8Bit().constData()); @@ -205,11 +199,7 @@
// qWarning("dirsData::resetFileName() - b->getType() = %d",getType());
if(files[k].isDir())
if(!ren[k].oldExtension.isEmpty()){
- // deleted by Krazy2
- // ren[k].oldName=ren[k].oldName+"."+ren[k].oldExtension;
ren[k].oldName=ren[k].oldName+'.'+ren[k].oldExtension;
- // deleted by Krazy2
- // ren[k].oldExtension=QString::null;
ren[k].oldExtension.clear();
}
// qWarning("dirsData::resetFileName() - fixed ren[k].oldExtension = \
%s",ren[k].oldExtension.toLocal8Bit().constData()); @@ -354,9 +344,6 @@
//qWarning("valid = %s",ren[i].oldName.toLocal8Bit().constData());
ll[i]=i;
QString tmp=ren[i].oldName;
- // deleted by Krazy2
- // tmp.replace(QRegExp(QRegExp::escape(toRef[0])),"");
- // tmp.replace(QRegExp(QRegExp::escape(toRef[2])),"");
tmp.remove(QRegExp(QRegExp::escape(toRef[0])));
tmp.remove(QRegExp(QRegExp::escape(toRef[2])));
//qWarning("number = %s",tmp.toLocal8Bit().constData());
@@ -372,8 +359,6 @@
if(ll[i]!=-1){
long min=num[i];
int id=i;
- // deleted by Krazy2
- // for(j=i+1;j<items();j++) if(ll[j]!=-1 && min>=num[j]){
for(j=i+1;j<items();++j){
// qWarning("i=%d j=%d, items=%d",i,j,items());
if(ll[j]!=-1 && min>=num[j]){
--- trunk/playground/utils/gwenrename/src/exif.cpp #994025:994026
@@ -57,12 +57,14 @@
// ff.at(0); old impl
ff.seek(0);
// for(i=0;i<99;i++) s[i]=(char) ff.getch(); old impl
- for(i=0;i<99;i++) s[i]=(char) ff.getChar((char*) s[i]);
-
- for(i=0;i<93;i++){
+ // for(i=0;i<99;i++) s[i]=(char) ff.getChar((char*) s[i]); krazy2
+ for(i=0;i<99;++i) s[i]=(char) ff.getChar((char*) s[i]);
+// for(i=0;i<93;i++){ krazy2
+ for(i=0;i<93;++i){
if(s[i]==expected[0]){
//qWarning("E = %c",s[i]);
- for(j=i;j<i+6;j++){
+// for(j=i;j<i+6;j++){ krazy2
+ for(j=i;j<i+6;++j){
//qWarning("j = %d, j-i = %d",j,j-i);
//qWarning("s[j] = %c - expected[j-i] = %c\n",s[j],expected[j-i]);
if(s[j]!=expected[j-i])break;
@@ -138,7 +140,8 @@
// goto subIFD
// qWarning("checking sub iFD");
getSubOffset();
- for(i=0;i<numOfSunEntries;i++){
+// for(i=0;i<numOfSunEntries;i++){ krazy2
+ for(i=0;i<numOfSunEntries;++i){
// ff.at(offset+subIFDoffset+2+(i*12)); old impl
ff.seek(offset+subIFDoffset+2+(i*12));
ds >> id;
@@ -161,8 +164,6 @@
}
}
}
- // deleted by Krazy2
- // return QString(QString::null);
return QString();
}
//================================
--- trunk/playground/utils/gwenrename/src/iconload.cpp #994025:994026
@@ -54,8 +54,6 @@
if(pix[id].isNull()){
// qWarning(" pic is null!! (1)");
// qWarning(" trying new theme");
- // deleted by Krazy2
- // pic=kdir.locate("icon",theme+"/"+name);
pic=kdir.locate("icon",theme+'/'+name);
// qWarning(" pic = %s",pic.toLocal8Bit().constData());
pix[id]=QPixmap(pic);
--- trunk/playground/utils/gwenrename/src/initaskmode.ui #994025:994026
@@ -63,13 +63,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" \
/><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; \
font-size:9pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;"></p></body></html></string>
- </property>
<property name="alignment">
<set>Qt::AlignTop</set>
</property>
--- trunk/playground/utils/gwenrename/src/inputdir.cpp #994025:994026
@@ -93,8 +93,6 @@
void inpDir::textHasChanged( const QString & txt ){
bool mode=false;
- // deleted by Krazy2
- // if(txt.startsWith("/")){
if(txt.startsWith('/')){
QFileInfo f(txt);
if(f.exists() && f.isReadable() && f.isWritable())
--- trunk/playground/utils/gwenrename/src/main.cpp #994025:994026
@@ -148,18 +148,13 @@
if(args->count()==1){
QString tmp=args->url(0).path();
// qWarning("tmp = %s", tmp.toLocal8Bit().constData());
- // deleted by Krazy2
- // if(tmp.endsWith("/"))
if(tmp.endsWith('/'))
tmp=tmp.left(tmp.length()-1);
QFileInfo fInfo(tmp);
if(fInfo.isDir()){
if(!fInfo.isWritable()){
- QString m;
- m=i18n("Directory '%1' can not be renamed\nYou don't have write permission to \
this directory", tmp );
- // deleted by Krazy2
- // KMessageBox::error(0,m,QString::null,KMessageBox::AllowLink);
+ QString m=i18n("Directory '%1' can not be renamed\nYou don't have write \
permission to this directory", tmp ); \
KMessageBox::error(0,m,"",KMessageBox::AllowLink); args->clear();
return 0;
@@ -193,8 +188,6 @@
if(askResult==2){ // Files of folders passed normally
for(int i=0;i<args->count();i++){
- // deleted by Krazy2
- // if(args->url(i).path().endsWith("/")){
if(args->url(i).path().endsWith('/')){
QString tmp=args->url(i).path();
f.files[i].setFile(tmp.left(tmp.length()-1));
@@ -204,19 +197,13 @@
if(!f.canRename()){
for(int y=0;y<f.numOfFiles;y++){
if(!f.files[y].exists()){
- QString m;
- m=i18n("File '%1' does not exist\nPlease check your selection and try again", \
f.files[y].filePath() );
- // deleted by Krazy2
- // KMessageBox::error(0,m,QString::null,KMessageBox::AllowLink);
+ QString m=i18n("File '%1' does not exist\nPlease check your selection and try \
again", f.files[y].filePath() ); KMessageBox::error(0,m,"",KMessageBox::AllowLink);
args->clear();
return 0;
}
if(!f.files[y].isWritable()){
- QString m;
- m=i18n("File '%1' can not be renamed\nYou don't have write permission to this \
file", f.files[y].filePath() );
- // deleted by Krazy2
- // KMessageBox::error(0,m,QString::null,KMessageBox::AllowLink);
+ QString m=i18n("File '%1' can not be renamed\nYou don't have write permission \
to this file", f.files[y].filePath() ); \
KMessageBox::error(0,m,"",KMessageBox::AllowLink); args->clear();
return 0;
--- trunk/playground/utils/gwenrename/src/namepartbase.cpp #994025:994026
@@ -33,6 +33,7 @@
:QDialog()
{
setupUi(this);
+ textLabel1->setText(i18n("Please select part of the <b>original</b> filename to be \
included in the <b>new</b> filename")); lblMatch->setStyleSheet("background-color: \
#A2C511; color: White;"); lblSample->setStyleSheet("background-color: #A2C511;");
setWindowTitle(windowTitle()+" - GwenRename");
@@ -43,6 +44,7 @@
:QDialog()
{
setupUi(this);
+ textLabel1->setText(i18n("Please select part of the <b>original</b> filename to be \
included in the <b>new</b> filename")); lblIcon->setPixmap(ic->Icon(9));
buttonOk->setIcon(KIcon(ic->Icon(6)));
buttonCancel->setIcon(KIcon(ic->Icon(7)));
--- trunk/playground/utils/gwenrename/src/namepartbase.ui #994025:994026
@@ -34,12 +34,8 @@
</item>
<item>
<widget class="QLabel" name="textLabel1">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" \
/><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'DejaVu Sans'; \
font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please select part of \
the <span style=" font-weight:600;">original </span>filename to \
be included in the <span style=" font-weight:600;">new</span> \
filename</p></body></html></string> + <property \
name="textFormat"> + <enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
--- trunk/playground/utils/gwenrename/src/rename.ui #994025:994026
@@ -43,6 +43,11 @@
<property name="sortingEnabled">
<bool>true</bool>
</property>
+ <column>
+ <property name="text">
+ <string notr="true">1</string>
+ </property>
+ </column>
</widget>
</item>
<item>
@@ -750,15 +755,6 @@
<string>Space manipulation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
- <property name="spacing">
- <number>0</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
--- trunk/playground/utils/gwenrename/src/timestamp.cpp #994025:994026
@@ -74,7 +74,9 @@
updateFormat();
}
-timeStamp::timeStamp(QWidget* , iconload* ic ){
+timeStamp::timeStamp(QWidget* , iconload* ic )
+ :QDialog()
+{
setupUi(this);
QString msg="<html><body><p><font size=\"+3\"><b>";
msg+=i18n("Time stamping format");
--- trunk/playground/utils/gwenrename/src/timestamp.h #994025:994026
@@ -29,7 +29,8 @@
#include "main.h"
#include <QtGui/QDialog>
#include <QMouseEvent>
-#include "qstring.h"
+#include <QString>
+#include <KDialog>
--- trunk/playground/utils/gwenrename/src/timestamp.ui #994025:994026
@@ -269,7 +269,7 @@
</size>
</property>
<property name="html">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> + <string \
notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> \
<html><head><meta name="qrichtext" content="1" \
/><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; \
font-size:9pt; font-weight:400; font-style:normal;">
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic