Changeset View
Changeset View
Standalone View
Standalone View
src/core/kfileitem.cpp
Show First 20 Lines • Show All 1233 Lines • ▼ Show 20 Line(s) | |||||
1234 | { | 1234 | { | ||
1235 | if (!d) { | 1235 | if (!d) { | ||
1236 | return false; | 1236 | return false; | ||
1237 | } | 1237 | } | ||
1238 | 1238 | | |||
1239 | return !isDir(); | 1239 | return !isDir(); | ||
1240 | } | 1240 | } | ||
1241 | 1241 | | |||
1242 | #ifndef KIOCORE_NO_DEPRECATED | | |||
dfaure: I'm confused, isn't this what *_BUILD_DEPRECATED_SINCE is for?
[repeats] | |||||
kossebau: See other comment. | |||||
1243 | bool KFileItem::acceptsDrops() const | 1242 | bool KFileItem::acceptsDrops() const | ||
1244 | { | 1243 | { | ||
1245 | // A directory ? | 1244 | // A directory ? | ||
1246 | if (isDir()) { | 1245 | if (isDir()) { | ||
1247 | return isWritable(); | 1246 | return isWritable(); | ||
1248 | } | 1247 | } | ||
1249 | 1248 | | |||
1250 | // But only local .desktop files and executables | 1249 | // But only local .desktop files and executables | ||
1251 | if (!d->m_bIsLocalUrl) { | 1250 | if (!d->m_bIsLocalUrl) { | ||
1252 | return false; | 1251 | return false; | ||
1253 | } | 1252 | } | ||
1254 | 1253 | | |||
1255 | if (mimetype() == QLatin1String("application/x-desktop")) { | 1254 | if (mimetype() == QLatin1String("application/x-desktop")) { | ||
1256 | return true; | 1255 | return true; | ||
1257 | } | 1256 | } | ||
1258 | 1257 | | |||
1259 | // Executable, shell script ... ? | 1258 | // Executable, shell script ... ? | ||
1260 | if (QFileInfo(d->m_url.toLocalFile()).isExecutable()) { | 1259 | if (QFileInfo(d->m_url.toLocalFile()).isExecutable()) { | ||
1261 | return true; | 1260 | return true; | ||
1262 | } | 1261 | } | ||
1263 | 1262 | | |||
1264 | return false; | 1263 | return false; | ||
1265 | } | 1264 | } | ||
1266 | #endif | | |||
1267 | 1265 | | |||
1268 | QString KFileItem::getStatusBarInfo() const | 1266 | QString KFileItem::getStatusBarInfo() const | ||
1269 | { | 1267 | { | ||
1270 | if (!d) { | 1268 | if (!d) { | ||
1271 | return QString(); | 1269 | return QString(); | ||
1272 | } | 1270 | } | ||
1273 | 1271 | | |||
1274 | QString text = d->m_strText; | 1272 | QString text = d->m_strText; | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
1366 | { | 1364 | { | ||
1367 | if (!d) { | 1365 | if (!d) { | ||
1368 | return QString(); | 1366 | return QString(); | ||
1369 | } | 1367 | } | ||
1370 | 1368 | | |||
1371 | return d->time(which).toString(); | 1369 | return d->time(which).toString(); | ||
1372 | } | 1370 | } | ||
1373 | 1371 | | |||
1374 | #ifndef KIOCORE_NO_DEPRECATED | | |||
1375 | QString KFileItem::timeString(unsigned int which) const | 1372 | QString KFileItem::timeString(unsigned int which) const | ||
1376 | { | 1373 | { | ||
1377 | if (!d) { | 1374 | if (!d) { | ||
1378 | return QString(); | 1375 | return QString(); | ||
1379 | } | 1376 | } | ||
1380 | 1377 | | |||
1381 | switch (which) { | 1378 | switch (which) { | ||
1382 | case KIO::UDSEntry::UDS_ACCESS_TIME: | 1379 | case KIO::UDSEntry::UDS_ACCESS_TIME: | ||
1383 | return timeString(AccessTime); | 1380 | return timeString(AccessTime); | ||
1384 | case KIO::UDSEntry::UDS_CREATION_TIME: | 1381 | case KIO::UDSEntry::UDS_CREATION_TIME: | ||
1385 | return timeString(CreationTime); | 1382 | return timeString(CreationTime); | ||
1386 | case KIO::UDSEntry::UDS_MODIFICATION_TIME: | 1383 | case KIO::UDSEntry::UDS_MODIFICATION_TIME: | ||
1387 | default: | 1384 | default: | ||
1388 | return timeString(ModificationTime); | 1385 | return timeString(ModificationTime); | ||
1389 | } | 1386 | } | ||
1390 | } | 1387 | } | ||
1391 | #endif | | |||
1392 | 1388 | | |||
1393 | #ifndef KIOCORE_NO_DEPRECATED | | |||
1394 | void KFileItem::assign(const KFileItem &item) | 1389 | void KFileItem::assign(const KFileItem &item) | ||
1395 | { | 1390 | { | ||
1396 | *this = item; | 1391 | *this = item; | ||
1397 | } | 1392 | } | ||
1398 | #endif | | |||
1399 | 1393 | | |||
1400 | QUrl KFileItem::mostLocalUrl(bool *local) const | 1394 | QUrl KFileItem::mostLocalUrl(bool *local) const | ||
1401 | { | 1395 | { | ||
1402 | if (!d) { | 1396 | if (!d) { | ||
1403 | return QUrl(); | 1397 | return QUrl(); | ||
1404 | } | 1398 | } | ||
1405 | 1399 | | |||
1406 | const QString local_path = localPath(); | 1400 | const QString local_path = localPath(); | ||
▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines |
I'm confused, isn't this what *_BUILD_DEPRECATED_SINCE is for?
[repeats]